Search Unity

IL2CPP error

Discussion in 'macOS' started by jkampitakis, Oct 19, 2018.

  1. Grimmjow_Jaegerjackquez

    Grimmjow_Jaegerjackquez

    Joined:
    Dec 14, 2021
    Posts:
    16
    Getting this error while using IL2CPP as scripting backend -


    D:\Unity\2021.3.22f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe --convert-to-cpp --assembly=Library/Bee/artifacts/Android/ManagedStripped/Assembly-CSharp-firstpass.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Assembly-CSharp.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/assets.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/ICSharpCode.SharpZipLib.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Mono.Security.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/mscorlib.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Configuration.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Core.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Numerics.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/System.Xml.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Timeline.Samples.Annotation.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Timeline.Samples.Text.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Timeline.Samples.TimeDilation.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Timeline.Samples.Tween.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Timeline.Samples.Utilities.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Timeline.Samples.Video.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.TextMeshPro.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/Unity.Timeline.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AndroidJNIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AnimationModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.AudioModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.CoreModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.DirectorModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.GridModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.IMGUIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.InputLegacyModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.ParticleSystemModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.Physics2DModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.PhysicsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.SharedInternalsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.SpriteShapeModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TextCoreFontEngineModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TextCoreTextEngineModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TextRenderingModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.TilemapModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UI.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UIElementsModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UIElementsNativeModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UIModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.UnityWebRequestModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.VehiclesModule.dll --assembly=Library/Bee/artifacts/Android/ManagedStripped/UnityEngine.VideoModule.dll --data-folder=D:/Flexsin Projects/Bull Racing/Library/Bee/artifacts/Android/il2cppOutput/data --generatedcppdir=D:/Flexsin Projects/Bull Racing/Library/Bee/artifacts/Android/il2cppOutput/cpp --enable-analytics --emit-null-checks --enable-array-bounds-check --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=D:/Flexsin Projects/Bull Racing/Library/Bee/artifacts/il2cpp_conv_dv6o.traceevents --print-command-line
    Error: IL2CPP error for method 'System.Collections.Generic.List`1<> <Module>::()' in assembly 'D:\Flexsin Projects\Bull Racing\Library\Bee\artifacts\Android\ManagedStripped\assets.dll'
    System.ArgumentException: System.Object is not an array type (Parameter 'typeReference')
    at Unity.IL2CPP.ArrayUtilities.ArrayElementTypeOf(ResolvedTypeInfo typeReference)
    at Unity.IL2CPP.MethodBodyWriter.LoadElemRef(StackInfo array, StackInfo index)
    at Unity.IL2CPP.MethodBodyWriter.ProcessInstruction(Node node, InstructionBlock block, ResolvedInstruction ins)
    at Unity.IL2CPP.MethodBodyWriter.GenerateCodeRecursive(Node node, ReadOnlyDictionary`2 instructionBlocks)
    at Unity.IL2CPP.MethodBodyWriter.Generate()
    at Unity.IL2CPP.CodeWriters.CodeWriterExtensions.WriteMethodWithMetadataInitialization(IGeneratedMethodCodeWriter writer, String methodSignature, Action`2 writeMethodBody, String uniqueIdentifier, MethodReference methodRef, Boolean writingMethodBody)
    at Unity.IL2CPP.MethodWriter.WriteMethodDefinition(AssemblyWriteContext context, IGeneratedMethodCodeWriter writer, MethodReference method)
    at Unity.IL2CPP.SourceWriter.WriteTypesMethods(SourceWritingContext context, IGeneratedMethodCodeWriter writer, TypeWritingInformation& writingInformation, NPath filePath, Boolean writeMarshalingDefinitions)
    at Unity.IL2CPP.SourceWriters.SourceWriterBase`2.WriteItem(StreamWorkItemData`2 data)
    at Unity.IL2CPP.Contexts.Scheduling.Streams.FileLevelParallelStreamManager`3.WorkerWriteItemsToFile(WorkItemData`2 data)
    at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    What is in that assets.dll file? I wonder if it has some invalid IL code. It looks like that might be the cause of this error.

    Can you open it with ILSpy or a similar tool? That might give us a hint about the cause of the problem.
     
  3. Grimmjow_Jaegerjackquez

    Grimmjow_Jaegerjackquez

    Joined:
    Dec 14, 2021
    Posts:
    16
    Yes , Opened it but how do I debug it?
    Should I share it here somehow?
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    If it opens in ILSpy, that is a good sign, at least part of it is not corrupt. To be sure though, you can run it through PEVerify (https://learn.microsoft.com/en-us/dotnet/framework/tools/peverify-exe-peverify-tool). That tool will indicate if it has any errors.

    Do you know what produced this .dll file? If it is from the C# compiler, then it is probably valid. But if another tool modified it, then it could be invalid.
     
  5. Grimmjow_Jaegerjackquez

    Grimmjow_Jaegerjackquez

    Joined:
    Dec 14, 2021
    Posts:
    16
    Well I think PEverify can't help here since the file extension is not .exe so I am getting errors while trying to verify it.
    Actually I am working on someone else's code that's why can't pin point where this assets.dll file came from.
     
    Last edited: Jul 18, 2023
  6. Grimmjow_Jaegerjackquez

    Grimmjow_Jaegerjackquez

    Joined:
    Dec 14, 2021
    Posts:
    16
    My Issue is resolved.I have removed that assets.dll from project and now build is working fine. I found that there is an external sdk which had a incorrect method but was still being used.
    Thanks @JoshPeterson
     
    JoshPeterson likes this.