I have build the project for WebGL and found this happy error message in runtime:
Error message
[Error] NotSupportedException: Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection.Emit/AssemblyBuilder.cpp(22) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.
_JS_Log_Dump (SV-dev.js, line 10084)
_JS_Log_Dump__wrapper (SV-dev.js, line 6151924)
dynCall_vii (SV-dev.js, line 6147376)
invoke_vii (SV-dev.js, line 16097)
__Z40DebugStringToFilePostprocessedStacktracePKcS0_S0_iS0_iiiiPFvRK11CppLogEntryE (SV-dev.js, line 2246298)
dynCall_viiiiiiiiii (SV-dev.js, line 6056041)
invoke_viiiiiiiiii (SV-dev.js, line 16193)
__ZN9Scripting12LogExceptionEP18ScriptingExceptioniRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE (SV-dev.js, line 3818511)
dynCall_viii (SV-dev.js, line 6141833)
invoke_viii (SV-dev.js, line 14993)
__ZN25ScriptingInvocationNoArgs6InvokeEPP18ScriptingException (SV-dev.js, line 4218115)
__ZN25ScriptingInvocationNoArgs6InvokeEv (SV-dev.js, line 6064428)
__ZN13MonoBehaviour16CallUpdateMethodEi (SV-dev.js, line 4032119)
__ZN13MonoBehaviour6UpdateEv (SV-dev.js, line 6140252)
__ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv (SV-dev.js, line 3448142)
__ZN16BehaviourManager6UpdateEv (SV-dev.js, line 6131679)
dynCall_vi (SV-dev.js, line 6152013)
invoke_vi (SV-dev.js, line 16273)
__Z10PlayerLoopbbP10IHookEvent (SV-dev.js, line 448988)
__ZL8mainloopv (SV-dev.js, line 5678428)
dynCall_v (SV-dev.js, line 6154843)
dynCall (SV-dev.js, line 203)
(anonymous function) (SV-dev.js, line 10207)
runIter (SV-dev.js, line 6961)
Browser_mainLoop_runner (SV-dev.js, line 10203)
Well, first of all, this message is not very informative. I can’t find any ‘using System.Reflection.Emit’ in our code, so probably it’s somewhere in dll files. Probably it’s possible to improve those error messages to help out a little bit?
Update. Our game runs perfectly on iOS, so we don’t use Reflection. Therefore, if anything still is using reflection, it’s because of a compiler flag that needs to be edited to include UNITY_WEBGL just like UNITY_IPHONE. So wee need to figure out where and what is doing it.