- Home /
Compile errors using WebGl plattform
Hi,
I want to add WebGl plattform support for my project and just struggle with the following errors compiling in WebGl on Unity 5.0.0f4. Maybe you have some ideas fixing those. Especially what dll's work with WebGl and which won't. Thank's in advance!
Best, Andre
Failed running C:\Program Files\Unity 5.0.0f4\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed" -l none -c link -x "C:\Program Files\Unity 5.0.0f4\Editor\Data\Tools\native_link.xml" -f "C:\Program Files\Unity 5.0.0f4\Editor\Data\il2cpp\LinkerDescriptors" -x "D:\Unity Projects\Chatbot_WebGL/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed" -a "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" -a "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" -a "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\Jurassic.dll" -a "D:\Unity Projects\Chatbot_WebGL\Temp\StagingArea\Data\Managed\System.Drawing.dll"
stdout:
Fatal error in Mono CIL Linker
System.Exception: Error processing method: 'System.Void System.Drawing.GDIPlus::CheckStatus(System.Drawing.Status)' in assembly: 'System.Drawing.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.IO.InternalBufferOverflowException::.ctor(System.String)
at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.Process () [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0
at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
stderr:
UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:192)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:185)
UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:136)
UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, String&, String, String, IEnumerable`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:121)
UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:431)
UnityEditorInternal.IL2CPPBuilder:StripAssemblies(String[], String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:419)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:273)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:218)
UnityEditor.HostView:OnGUI()
Running a new project with empty scene does compile. Thus it seems to be a problem with the used api/dll's
at tanoshimi: Thank you for your answer. The reason why i use 5.0.0 is that i'm not doing it for myself, but for the customers who almost never have the newest unity version. Thus I try to develope for the oldest unity version possible. WebGL was first introduced with Unity 5.0.0 and I would like to develope for the lowest version possible. But you're right - I should try if it compiles using newer Unity versions.
Thanks a lot!
Now, it seems that compiling with Unity 5.3.1 not works neither. But the error log is shorter and a bit different:
Failed running C:\Program Files\Unity 5.3.1f1\Editor\Data\Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "D:\Unity Projects\Chatbot_WebGL_5.3.1\Temp\StagingArea\Data\$$anonymous$$anaged\tempStrip" -l none -c link -b False -x "C:\Program Files\Unity 5.3.1f1\Editor\Data\PlaybackEngines\WebGLSupport\Whitelists\Core.xml" -f "C:\Program Files\Unity 5.3.1f1\Editor\Data\il2cpp\LinkerDescriptors" -x "D:\Unity Projects\Chatbot_WebGL_5.3.1/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -d "D:\Unity Projects\Chatbot_WebGL_5.3.1\Temp\StagingArea\Data\$$anonymous$$anaged" -a "D:\Unity Projects\Chatbot_WebGL_5.3.1\Temp\StagingArea\Data\$$anonymous$$anaged\Assembly-CSharp.dll"
stdout:
Fatal error in $$anonymous$$ono CIL Linker
System.Exception: Error processing method: 'System.Void System.Drawing.GDIPlus::CheckStatus(System.Drawing.Status)' in assembly: 'System.Drawing.dll' ---> $$anonymous$$ono.Cecil.ResolutionException: Failed to resolve System.Void System.IO.InternalBufferOverflowException::.ctor(System.String)
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.$$anonymous$$ark$$anonymous$$ethod($$anonymous$$ethodReference reference)
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.$$anonymous$$arkInstruction(Instruction instruction)
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.$$anonymous$$ark$$anonymous$$ethodBody($$anonymous$$ethodBody body)
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.Process$$anonymous$$ethod($$anonymous$$ethodDefinition method)
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.ProcessQueue()
--- End of inner exception stack trace ---
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.ProcessQueue()
at $$anonymous$$ono.Linker.Steps.$$anonymous$$arkStep.Process()
at $$anonymous$$ono.Linker.Pipeline.Process(LinkContext context)
at $$anonymous$$ono.Linker.Driver.RunDriver(Driver driver)
stderr:
etc..
so, it's probably the System.Drawing library..
Answer by SkandYxyz · Feb 16, 2016 at 08:35 PM
Okay, I found the answer:
You need to set Api Compatibility Level to .Net 2.0. And you need to use Unity 5.2.0f3 upwards. This fixes all errors.
Thanks alot!
Best, Andre
Answer by tanoshimi · Feb 16, 2016 at 07:07 PM
5.0.0 is old! WebGL export is still very much a bleeding-edge feature, so if you want to use it you should always be running the latest version.
Your answer
![](https://koobas.hobune.stream/wayback/20220612064449im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
webgl error 0 Answers
Error when other people try to start my project. 1 Answer
Cannot load native dll in WebGL build 0 Answers
Error building Unity project in WebGL 0 Answers
Error 127 on loading game in browser 1 Answer