Search Issue Tracker

Fixed in 5.5.0

Votes

1

Found in

5.3.5f1

Issue ID

811997

Regression

No

[WebGL] IL2CPP Errors when building for WebGL and a Managed C++ DLL

WebGL

-

Steps to reproduce:
1. Download and open attached project.
2. In the build settings select WebGL as a target platform.
3. Try building a project for WebGL.

Expected result:
The building process should succeed when building for WebGL with a C++ managed DLL.

Actual result:
After some time the building process fails and the "Console" window outputs these four error messages:

1.
IL2CPP error for method 'System.Void UnityEngine.UI.ObjectPool`1::Release(T)' in assembly 'C:\Users\Admin\Downloads\case_811997-TestDLL\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll'
Additional information: Build a development build for more information. Object reference not set to an instance of an object.

2.
Failed running C:\Program Files\5.3.5p6\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --extra-types.file="C:\Program Files\5.3.5p6\Editor\Data\il2cpp\il2cpp_default_extra_types.txt" --assembly="C:\Users\Admin\Downloads\case_811997-TestDLL\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll"

3.
Exception: C:\Program Files\5.3.5p6\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:96)

4.
Error building Player: Exception: C:\Program Files\5.3.5p6\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!

Note:
When building a development build the "Console" window outputs these four messages:

1.
IL2CPP error for method 'System.Void UnityEngine.UI.ObjectPool`1::Release(T)' in ObjectPool.cs:46
Additional information: Object reference not set to an instance of an object.

2.
Failed running C:\Program Files\5.3.5p6\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --enable-symbol-loading --development-mode --extra-types.file="C:\Program Files\5.3.5p6\Editor\Data\il2cpp\il2cpp_default_extra_types.txt" --assembly="C:\Users\Admin\Downloads\case_811997-TestDLL\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" --assembly="C:\Users\Admin\Downloads\case_811997-TestDLL\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" --assembly="C:\Users\Admin\Downloads\case_811997-TestDLL\Temp\StagingArea\Data\Managed\UnityEngine.dll" --generatedcppdir="C:\Users\Admin\Downloads\case_811997-TestDLL\Temp\StagingArea\Data\il2cppOutput"

stdout:
IL2CPP error for method 'System.Void UnityEngine.UI.ObjectPool`1::Release(T)' in C:\buildslave\unity\build\Extensions\guisystem\UnityEngine.UI\UI\Core\Utility\ObjectPool.cs:46
Additional information: Object reference not set to an instance of an object.
il2cpp.exe didn't catch exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Unity.IL2CPP.Extensions.<GetConstructibleCustomAttributes>m__10(CustomAttribute ca)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Unity.IL2CPP.AttributesSupport.WriteCustomAttributesCacheGeneratorFor(String name, ICustomAttributeProvider customAttributeProvider)
at Unity.IL2CPP.AttributesSupport.WriteCustomAttributesCacheGenerators(TypeDefinition type)
at Unity.IL2CPP.AttributesSupport.WriteAttributes(IEnumerable`1 assemblyDefinitions)
at Unity.IL2CPP.SourceWriter.WriteCollectedMetadata(InflatedCollectionCollector genericsCollectionCollector, ICollection`1 usedAssemblies, NPath outputDir, NPath dataFolder, IMetadataCollection metadataCollection, AttributeCollection attributeCollection, VTableBuilder vTableBuilder, IMethodCollectorResults methodCollector)
at Unity.IL2CPP.AssemblyConverter.Apply()
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(NPath[] assemblies, NPath outputDir, NPath dataFolder)
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder)
at il2cpp.Program.DoRun(String[] args)
at il2cpp.Program.Run(String[] args)
at il2cpp.Program.Main(String[] args)
stderr:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Unity.IL2CPP.Extensions.<GetConstructibleCustomAttributes>m__10(CustomAttribute ca)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Unity.IL2CPP.AttributesSupport.WriteCustomAttributesCacheGeneratorFor(String name, ICustomAttributeProvider customAttributeProvider)
at Unity.IL2CPP.AttributesSupport.WriteCustomAttributesCacheGenerators(TypeDefinition type)
at Unity.IL2CPP.AttributesSupport.WriteAttributes(IEnumerable`1 assemblyDefinitions)
at Unity.IL2CPP.SourceWriter.WriteCollectedMetadata(InflatedCollectionCollector genericsCollectionCollector, ICollection`1 usedAssemblies, NPath outputDir, NPath dataFolder, IMetadataCollection metadataCollection, AttributeCollection attributeCollection, VTableBuilder vTableBuilder, IMethodCollectorResults methodCollector)
at Unity.IL2CPP.AssemblyConverter.Apply()
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(NPath[] assemblies, NPath outputDir, NPath dataFolder)
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder)
at il2cpp.Program.DoRun(String[] args)
at il2cpp.Program.Run(String[] args)
at il2cpp.Program.Main(String[] args)

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:94)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:324)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:203)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:135)
UnityEditor.HostView:OnGUI()

3.
Exception: C:\Program Files\5.3.5p6\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:96)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (ICollection`1 userAssemblies, System.String outputDirectory, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:324)
UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:203)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action`1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry, Boolean developmentBuild) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:135)
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:301)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

4.
Error building Player: Exception: C:\Program Files\5.3.5p6\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!

Reproduced with:
5.3.5p6, 5.4.0b24.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.