Failed build

Just giving webgl a try on a project with 5.3.3 but can not build - get an error like this:

Failed running “C:\Program Files\Unity5.3.3\Editor\Data\PlaybackEngines\WebGLSupport/BuildTools/Emscripten_Win/python/2.7.5.3_64bit/python.exe” “C:\Program Files\Unity5.3.3\Editor\Data\PlaybackEngines\WebGLSupport/BuildTools/Emscripten/emcc” -Oz -std=c++11 -Wno-unused-value -Wno-invalid-offsetof -I-I"C:/design-app/Assets/…/Temp/StagingArea/Data\Libraries\bdwgc/include" -I"C:/design-app/Assets/…/Temp/StagingArea/Data\Libraries\libil2cpp/include" -I"C:/design-app/Assets/…/Temp/StagingArea/Data\il2cppOutput" -nostdinc -DIL2CPP_EXCEPTION_DISABLED=1 -c @“C:\Users\xxx\AppData\Local\Temp\tmp29ac6c97.tmp”

WARNING root: did not see a source tree above or next to the LLVM root directory (guessing based on directory of C:\Program Files\Unity5.3.3\Editor\Data\PlaybackEngines\WebGLSupport/BuildTools/Emscripten_FastComp_Win\llc), could not verify version numbers match
INFO root: (Emscripten: Running sanity checks)
WARNING root: java does not seem to exist, required for closure compiler, which is optional (define JAVA in ~/.emscripten if you want it)
WARNING root: -I or -L of an absolute path “-IC:/design-app/Assets/…/Temp/StagingArea/Data\Libraries\libil2cpp/include” encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass ‘-Wno-warn-absolute-paths’ to emcc to hide this warning.
C:/design-app/Assets/…/Temp/StagingArea/Data\il2cppOutput\Bulk_Assembly-UnityScript_6.cpp:33320:3: error: no matching function for call to ‘ObjectManager_HideObjects_m1233987725’
ObjectManager_HideObjects_m1233987725(__this, L_79, /hidden argument/NULL);

Anyone? Webgl still a problem for larger projects?

Hello andyz.

Could you create a bug report for this issue with your project attached? Please post the case number here.

This is actually a bug when you cast a List to List it seems.
Perhaps a rarity, but works outside of webgl!
Minimal example provided: case 787600

This actually seems to be a js oddity as in C# you can not cast from one List type to another in the same way. So not an issue that is gonna come up often - probably why it hasn’t been handled

This is correct. In C# variance for List is not allowed. Although it seems to work in UnityScript, I believe it is also not allowed by il2cpp. The reason for this is the following:

function Start ()
{
   var list:List.<TestClass> = new List.<TestClass>();
   Test(list);
}

public class AnotherTestClass extends BaseTestClass
{
}

function Test(list:List.<BaseTestClass>)
{
   var btc:AnotherTestClass = new AnotherTestClass();
   list.Add(btc);
}

Although this code will not generate any compile errors, it will cause the following runtime error on list.Add(btc):
ArrayTypeMismatchException: Source array type cannot be assigned to destination array type.
Because the list of TestClass can not contain an element of AnotherTestClass.

In some situations it might be sufficient for you to create a list of casted elements to make the code work, the same way as you would do in C#:

import System.Linq;

Test(list.Cast.<BaseTestClass>().ToList());

Additional information regarding this case will be provided in the bug report.

1 Like