Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Nondescript IL2CPP build error (2018.2.f2)

Discussion in 'iOS and tvOS' started by jaclark, Sep 14, 2018.

  1. jaclark

    jaclark

    Joined:
    Sep 29, 2014
    Posts:
    19
    Moved here from another thread.

    We get this build error when building for iOS. It's pretty nondescript -- I see that it's an error with our render pipeline assembly, but I'm not sure beyond that.
    And here's the full error from the log.
    Couple weird things:
    It seems to come up randomly. Our builds have been fine -- I changed one unrelated line of code (has nothing to do with that render pipeline assembly), and it started to happen, and won't go away. I had just fixed an error (editor code in packaged build, had just removed that code when this occurred.) and this issue started happening. Reverting that code doesn't help.
    I'm building a development build, but it doesn't seem to recognize that and give more information.

    We had this issue before -- I rearranged some of our assembly definition files and it seemed to fix it. However, it's back and I'm stuck again. :/
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Can you submit a bug report with the project in a state that causes this issue? This is a bug in IL2CPP. Unfortunately, I don't see a work around for it now, but we should be able to correct it.
     
  3. jaclark

    jaclark

    Joined:
    Sep 29, 2014
    Posts:
    19
    We're working on getting a stripped version of the project & sending a bug report!
     
    JoshPeterson likes this.
  4. jaclark

    jaclark

    Joined:
    Sep 29, 2014
    Posts:
    19
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    Thanks! When the bug is corrected, the fix will end up in a Unity patch release. We'll let you know the release which has the fix, and any work around you can apply in your version.
     
    jaclark likes this.
  6. andiCR

    andiCR

    Joined:
    Sep 6, 2012
    Posts:
    27
    Hey @JoshPeterson , we're getting this error too. When is the patch going to be applied? Is there a workaround?
    Code (CSharp):
    1. Failed running /Applications/Unity/Hub/Editor/2018.2.14f1/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --map-file-parser=/Applications/Unity/Hub/Editor/2018.2.14f1/Unity.app/Contents/Tools/MapFileParser/MapFileParser” --assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Gazeus-Helper.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Gazeus-Runtime.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Sirenix.Serialization.Config.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Facebook.Unity.Settings.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/UnityEngine.Analytics.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/UnityEngine.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Sirenix.OdinInspector.Attributes.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Sirenix.Serialization.AOTGenerated.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Sirenix.Serialization.dll--assembly=/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Sirenix.Utilities.dll--generatedcppdir=/Users/rgasi/Projects/games/gun-blast/Temp/il2cppOutput/il2cppOutput”
    2. stdout:
    3. IL2CPP error for type ‘<PrivateImplementationDetails>/$ArrayType=72in assembly ‘/Users/rgasi/Projects/games/gun-blast/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll
    4. Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
    5. il2cpp.exe didn’t catch exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Exception of type ‘System.Exception’ was thrown.
    6.    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    7.    at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
    8.    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, GenericInstanceType genericInstanceType)
    9.    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodReference methodReference, Context context)
    10.    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(Instruction instruction, Context context)
    11.    at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    12.    at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    13.    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodDefinition methodDefinition, Context context)
    14.    at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    15.    at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    16.    at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    17.    --- End of inner exception stack trace ---
    18.    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    19.    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    20.    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    21.    at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    22.    at Unity.IL2CPP.GenericsCollection.GenericsCollector.CollectPerAssembly(IInteropDataCollector interopDataCollector, AssemblyDefinition assembly)
    23.    at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
    24.    at Unity.IL2CPP.GenericsCollection.GenericsCollector.MergeCollections(IEnumerable`1 collections)
    25.    at Unity.IL2CPP.AssemblyConverter.Apply()
    26.    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)
    27.    at il2cpp.Program.DoRun(String[] args)
    28.    at il2cpp.Program.Run(String[] args)
    29.    at il2cpp.Program.Main(String[] args)
    30. stderr:
    31. Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Exception of type ‘System.Exception’ was thrown.
    32.    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    33.    at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
    34.    at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, GenericInstanceType genericInstanceType)
    35.    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodReference methodReference, Context context)
    36.    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(Instruction instruction, Context context)
    37.    at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    38.    at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    39.    at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodDefinition methodDefinition, Context context)
    40.    at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    41.    at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    42.    at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    43.    --- End of inner exception stack trace ---
    44.    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    45.    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    46.    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    47.    at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    48.    at Unity.IL2CPP.GenericsCollection.GenericsCollector.CollectPerAssembly(IInteropDataCollector interopDataCollector, AssemblyDefinition assembly)
    49.    at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
    50.    at Unity.IL2CPP.GenericsCollection.GenericsCollector.MergeCollections(IEnumerable`1 collections)
    51.    at Unity.IL2CPP.AssemblyConverter.Apply()
    52.    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)
    53.    at il2cpp.Program.DoRun(String[] args)
    54.    at il2cpp.Program.Run(String[] args)
    55.    at il2cpp.Program.Main(String[] args)
    56.    at Program.Main(String[] args)
    57. UnityEngine.Debug:LogError(Object)
    58. UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
    59. UnityEditorInternal.Runner:RunNetCoreProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:79)
    60. UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:378)
    61. UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:361)
    62. UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:178)
    63. UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:35)
    64. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,779
    @andiCR

    The latest 2018.3 beta release has an improved error message for this case. The error was caused by some invalid IL code in the original bug report. I'm not sure if you have similar IL code in your project, but the new error message should indicate at least where the problem is located.
     
  8. andiCR

    andiCR

    Joined:
    Sep 6, 2012
    Posts:
    27
    Thanks @JoshPeterson. I had a hunch of what could be happening, and since we've been using Odin Inspector - which uses a bunch of reflection, i figured it was related to this. Odin uses an AOT generated dll with your serializable types, and it hadn't been regenerated in a while. For some reason it started giving problems now and the team was stuck for a couple of days. Fortunately just regenerating the dll seemed to have worked. Posting this just in case someone in the future gets stuck with a simliar problem.
    Thanks for the info on 2018.3 beta. I'll be sure to take a look on it if something similar rearises.
     
    jaclark and JoshPeterson like this.