Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

IL2CPP error for type '<PrivateImplementationDetails>/$ArrayType=40'

Discussion in 'Experimental Scripting Previews' started by hungrybelome, May 27, 2018.

  1. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    Hi, when building with IL2CPP for IOS I get this error:

    Code (CSharp):
    1. IL2CPP error for type '<PrivateImplementationDetails>/$ArrayType=40' in assembly '/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
    2. Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
    3.  
    I'm trying to track down what may be causing this issue, but this error description is not very helpful. I've tried compiling as a debug build, but the error does not provide more information.

    I'm trying to think how I can track down the script/dll that might be causing this issue. Anyone have any suggestions? Thanks!

    I'm using 2018.1.0f2 building for 4.x equivalent and .net standard 2.0.

    Here is the rest of the error:

    Code (CSharp):
    1. Failed running /Applications/Unity/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --development-mode --dotnetprofile="unityaot" --map-file-parser="/Applications/Unity/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/UnityEngine.Networking.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/UnityEngine.SpatialTracking.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/TextMeshPro-1.0.55.2017.2.0b12.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/ES2.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Sirenix.Serialization.Config.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/DOTween.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/UnityEngine.Analytics.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/UnityEngine.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Sirenix.OdinInspector.Attributes.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Sirenix.Serialization.AOTGenerated.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Sirenix.Serialization.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Sirenix.Utilities.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Stores.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/UnityEngine.Purchasing.dll" --assembly="/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/mscorlib.dll" --generatedcppdir="/Users/belome/Workspace/vr/MyGame/Temp/il2cppOutput/il2cppOutput"
    2.  
    3. stdout:
    4. IL2CPP error for type '<PrivateImplementationDetails>/$ArrayType=40' in assembly '/Users/belome/Workspace/vr/MyGame/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
    5. Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
    6. 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.
    7.   at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    8.   at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
    9.   at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, GenericInstanceType genericInstanceType)
    10.   at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodReference methodReference, Context context)
    11.   at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(Instruction instruction, Context context)
    12.   at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    13.   at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    14.   at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodDefinition methodDefinition, Context context)
    15.   at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    16.   at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    17.   at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    18.   --- End of inner exception stack trace ---
    19.   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    20.   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    21.   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    22.   at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    23.   at Unity.IL2CPP.GenericsCollection.GenericsCollector.CollectPerAssembly(IInteropDataCollector interopDataCollector, AssemblyDefinition assembly)
    24.   at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
    25.   at Unity.IL2CPP.GenericsCollection.GenericsCollector.MergeCollections(IEnumerable`1 collections)
    26.   at Unity.IL2CPP.AssemblyConverter.Apply()
    27.   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)
    28.   at il2cpp.Program.DoRun(String[] args)
    29.   at il2cpp.Program.Run(String[] args)
    30.   at il2cpp.Program.Main(String[] args)
    31. stderr:
    32.  
    33. Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Exception of type 'System.Exception' was thrown.
    34.   at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, TypeReference typeReference)
    35.   at Unity.IL2CPP.GenericsCollection.Inflater.ConstructGenericType(GenericContext context, TypeDefinition typeDefinition, IEnumerable`1 genericArguments)
    36.   at Unity.IL2CPP.GenericsCollection.Inflater.InflateType(GenericContext context, GenericInstanceType genericInstanceType)
    37.   at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodReference methodReference, Context context)
    38.   at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(Instruction instruction, Context context)
    39.   at Unity.Cecil.Visitor.Visitor.Visit(MethodBody methodBody, Context context)
    40.   at Unity.Cecil.Visitor.Visitor.Visit(MethodDefinition methodDefinition, Context context)
    41.   at Unity.IL2CPP.GenericsCollection.GenericContextFreeVisitor.Visit(MethodDefinition methodDefinition, Context context)
    42.   at Unity.Cecil.Visitor.Visitor.Visit(TypeDefinition typeDefinition, Context context)
    43.   at Unity.Cecil.Visitor.Visitor.Visit(ModuleDefinition moduleDefinition, Context context)
    44.   at Unity.Cecil.Visitor.Visitor.Visit(AssemblyDefinition assemblyDefinition, Context context)
    45.   --- End of inner exception stack trace ---
    46.   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    47.   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    48.   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    49.   at Unity.Cecil.Visitor.Visitor.Visit[T](T node, Context context)
    50.   at Unity.IL2CPP.GenericsCollection.GenericsCollector.CollectPerAssembly(IInteropDataCollector interopDataCollector, AssemblyDefinition assembly)
    51.   at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
    52.   at Unity.IL2CPP.GenericsCollection.GenericsCollector.MergeCollections(IEnumerable`1 collections)
    53.   at Unity.IL2CPP.AssemblyConverter.Apply()
    54.   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)
    55.   at il2cpp.Program.DoRun(String[] args)
    56.   at il2cpp.Program.Run(String[] args)
    57.   at il2cpp.Program.Main(String[] args)
    58.   at Program.Main(String[] args)
    59.  
    60. 0   Unity                               0x0000000101aeecfc _Z13GetStacktracei + 92
    61. 1   Unity                               0x0000000100c9da6a _Z17DebugStringToFileRK21DebugStringToFileData + 810
    62. 2   Unity                               0x00000001029bc9f3 _ZN15DebugLogHandler12Internal_LogE7LogTypeN4core12basic_stringIcNS1_20StringStorageDefaultIcEEEEP6Object + 323
    63. 3   Unity                               0x00000001029bc7ba _Z35DebugLogHandler_CUSTOM_Internal_Log7LogTypeP10MonoStringP10MonoObject + 330
    64. 4  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
    65. 5  (Mono JIT Code) [BuildUtils.cs:80] UnityEditorInternal.Runner:RunNetCoreProgram (string,string,string,UnityEditor.Scripting.Compilers.CompilerOutputParserBase,System.Action`1<System.Diagnostics.ProcessStartInfo>)
    66.  
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    This looks like a bug in IL2CPP. Can you submit a debug report with this project?
     
  3. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    336
    Solved. Had a .dll referencing types only available when compiling for a different platform. Making sure that only valid types for the platform were referenced fixed it.
     
    JoshPeterson likes this.