Search Issue Tracker

By Design

Votes

0

Found in

2019.1.0b6

2019.1.1f1

2019.2.0a7

Issue ID

1152504

Regression

No

IL2CPP exception is thrown when building for iOS/Android platform

IL2CPP

-

How to reproduce:
1. Open the attached project
2. Go to File-> Build Settings-> Switch to iOS Platform and Build

Actual: Build fails with errors

Reproducible with: 2019.1.4f1, 2019.2.0b3, 2019.3.0a3

Note: Could not test with earlier versions because of the thrown errors

Build fails with errors:

IL2CPP error for type 'Avery.Unity.QualityAdjuster' in assembly '/Users/vita/Downloads/case_1152504-Archive (1)/Temp/StagingArea/Data/Managed/Avery.Unity.dll'
Additional information: Object reference not set to an instance of an object.

Failed running /Applications/2019.3/Unity 2019.3.0a1_d0267b43e228/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --profiler-report --map-file-parser="/Applications/2019.3/Unity 2019.3.0a1_d0267b43e228/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --directory="/Users/vita/Downloads/case_1152504-Archive (1)/Temp/StagingArea/Data/Managed" --generatedcppdir="/Users/vita/Downloads/case_1152504-Archive (1)/Temp/il2cppOutput/il2cppOutput"

stdout:
IL2CPP error for type 'Avery.Unity.QualityAdjuster' in assembly '/Users/vita/Downloads/case_1152504-Archive (1)/Temp/StagingArea/Data/Managed/Avery.Unity.dll'
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.Common.CecilExtensions.IsValueType(TypeReference typeReference)
at Unity.IL2CPP.CppCodeWriter.AddIncludesForTypeReference(TypeReference typeReference, Boolean requiresCompleteType)
at Unity.IL2CPP.TypeDefinitionWriter.CollectIncludes(IGeneratedCodeWriter writer, TypeReference type, TypeDefinition typeDefinition)
at Unity.IL2CPP.TypeDefinitionWriter.WriteTypeDefinitionFor(TypeReference type, IGeneratedCodeWriter writer, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.CppDeclarationsCollector.GetDeclarations(TypeReference type, CppDeclarationsCache cache, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.CppDeclarationsCollector.PopulateCache(IEnumerable`1 rootTypes, CppDeclarationsCache cache, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.CppDeclarationsWriter.Write(StreamWriter writer, ICppDeclarations declarationsIn, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.SourceCodeWriter.Dispose()
at Unity.IL2CPP.SourceWriter.WriteEqualSizedChunks[T](NPath outputDir, IEnumerable`1 items, String fileName, Int64 chunkSize, Action`1 writeHeaderAction, Action`2 writeItemAction, Action`1 writeFooterAction, SourceWritingContext sourceWritingContext, Action`2 writeEnd)
at Unity.IL2CPP.SourceWriter.WriteEqualSizedChunks[T](NPath outputDir, IEnumerable`1 items, String fileName, Int64 chunkSize, Action`2 writeItemAction, SourceWritingContext sourceWritingContext, Action`2 writeEnd)
at Unity.IL2CPP.SourceWriter.WriteMethodSourceFiles(NPath outputDirectory, SourceWritingContext sourceWritingContext, String fileName, IEnumerable`1 typeList, IMethodCollector methodCollector, Boolean writeMarshalingDefinitions)
at Unity.IL2CPP.SourceWriter.Write(NPath outputDir, SourceWritingContext sourceWritingContext, AssemblyDefinition assemblyDefinition, IMethodCollector methodCollector)
at Unity.IL2CPP.AssemblyConverter.Apply()
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
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.Common.CecilExtensions.IsValueType(TypeReference typeReference)
at Unity.IL2CPP.CppCodeWriter.AddIncludesForTypeReference(TypeReference typeReference, Boolean requiresCompleteType)
at Unity.IL2CPP.TypeDefinitionWriter.CollectIncludes(IGeneratedCodeWriter writer, TypeReference type, TypeDefinition typeDefinition)
at Unity.IL2CPP.TypeDefinitionWriter.WriteTypeDefinitionFor(TypeReference type, IGeneratedCodeWriter writer, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.CppDeclarationsCollector.GetDeclarations(TypeReference type, CppDeclarationsCache cache, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.CppDeclarationsCollector.PopulateCache(IEnumerable`1 rootTypes, CppDeclarationsCache cache, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.CppDeclarationsWriter.Write(StreamWriter writer, ICppDeclarations declarationsIn, IInteropDataCollector interopDataCollector)
at Unity.IL2CPP.SourceCodeWriter.Dispose()
at Unity.IL2CPP.SourceWriter.WriteEqualSizedChunks[T](NPath outputDir, IEnumerable`1 items, String fileName, Int64 chunkSize, Action`1 writeHeaderAction, Action`2 writeItemAction, Action`1 writeFooterAction, SourceWritingContext sourceWritingContext, Action`2 writeEnd)
at Unity.IL2CPP.SourceWriter.WriteEqualSizedChunks[T](NPath outputDir, IEnumerable`1 items, String fileName, Int64 chunkSize, Action`2 writeItemAction, SourceWritingContext sourceWritingContext, Action`2 writeEnd)
at Unity.IL2CPP.SourceWriter.WriteMethodSourceFiles(NPath outputDirectory, SourceWritingContext sourceWritingContext, String fileName, IEnumerable`1 typeList, IMethodCollector methodCollector, Boolean writeMarshalingDefinitions)
at Unity.IL2CPP.SourceWriter.Write(NPath outputDir, SourceWritingContext sourceWritingContext, AssemblyDefinition assemblyDefinition, IMethodCollector methodCollector)
at Unity.IL2CPP.AssemblyConverter.Apply()
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies(IEnumerable`1 assemblyDirectories, IEnumerable`1 explicitAssemblies, NPath outputDir, NPath dataFolder, NPath symbolsFolder, NPath executableAssembiesFolder, NPath monoLibFolder, NPath monoEtcFolder, NPath[] searchDirectories, String entryAssemblyName, NPath[] extraTypesFiles)
at il2cpp.Program.DoRun(String[] args)
at il2cpp.Program.Run(String[] args)
at il2cpp.Program.Main(String[] args)
at Program.Main(String[] args) in /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/il2cppcore/Program.cs:line 24

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:126)
UnityEditorInternal.Runner:RunNetCoreProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:77)
UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:502)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(String, String, String, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:485)
UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

xception: /Applications/2019.3/Unity 2019.3.0a1_d0267b43e228/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll did not run properly!
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:77)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:502)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.String inputDirectory, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:485)
UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
UnityEditor.iOS.PostProcessiPhonePlayer.CrossCompileManagedDlls (UnityEditor.iOS.PostProcessiPhonePlayer+BuildSettings bs, UnityEditor.iOS.PostProcessiPhonePlayer+ProjectPaths paths, UnityEditor.AssemblyReferenceChecker checker, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport buildReport) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:764)
UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.PostProcessiPhonePlayer+BuildSettings bs, UnityEditor.iOS.PostProcessiPhonePlayer+ProjectPaths paths, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport buildReport) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:615)
UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.PostProcessorSettings postProcessorSettings, UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:563)
UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/ExtensionModule.cs:45)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/ExtensionModule.cs:49)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Comments (1)

  1. abdjaouni

    Jul 13, 2019 07:03

    Reproducible with: 2019.1.10f1

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.