- Home /
IL2CPP Build Error
I get this problem. How to solve this problem ?
Exception: IL2CPP error (no further information about what managed code was being converted is available) System.NullReferenceException: Object reference not set to an instance of an object. at Unity.IL2CPP.Extensions.GetBaseType(TypeReference typeReference, ReadOnlyContext context) at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.AddStaticUsageRecursiveIfNeeded(ReadOnlyContext context, TypeReference genericType) at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Process(Instruction instruction, MethodDefinition method) at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.ProcessType(TypeDefinition type) at Unity.IL2CPP.GenericSharing.GenericSharingVisitor.Collect(AssemblyDefinition assembly) at Unity.IL2CPP.AssemblyConversion.PrimaryCollection.Steps.Global.GenericSharingAnalysis.ProcessItem(GlobalPrimaryCollectionContext context, AssemblyDefinition item) at Unity.IL2CPP.AssemblyConversion.Steps.Base.ScheduledItemsStepFuncWithContinueFunc`4.WorkerWrapper(WorkItemData`3 workerData) at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.ContinueWithResultsWorkItem`4.InvokeWorker(Object context, Int32 uniqueId) at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.BaseContinueWorkItem`2.Invoke(Object context, Int32 uniqueId) at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data) UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at :0) UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at :0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at :0) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at :0) UnityEditorInternal.IL2CPPBuilder.Run () (at :0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at :0) UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at :0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0) 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 :0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
I'd suggest to go comment out recently added code to pinpoint which part in your code leads to this issue.
Do you use any reflection/Linq methods in your code?
Which version of Unity are you using? I don't recall seeing this error before, but if it is a bug, it may be fixed in the latest Unity versions.
It looks like it is either a bug in IL2CPP or a problem with invalid IL code provided to IL2CPP.
Your answer
Follow this Question
Related Questions
Exception: Il2cp did not run properly. 2 Answers
Invalid location when saving uScript file 0 Answers
Lightmap bug 0 Answers
,why cant i build my project 0 Answers
WebGL Build Error: IL2CPP error 0 Answers