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. Dismiss Notice

My project from Unity4.5.2 upgrade to Unity4.6.3, set ScriptingBackend to IL2CPP, Build project fail

Discussion in 'iOS and tvOS' started by bigTree, Mar 11, 2015.

  1. bigTree

    bigTree

    Joined:
    Jul 24, 2014
    Posts:
    6
    My project from Unity4.5.2 upgrade to Unity4.6.3, set ScriptingBackend to IL2CPP, Build project fails, an error is as follows:

    Failed running /Applications/Unity4.6.3/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe --copy-level=None --enable-generic-sharing --enable-unity-event-support --emit-null-checks --enable-array-bounds-check "/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll" "/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" "/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/StagingArea/Data/Managed/Assembly-UnityScript-firstpass.dll" "/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll" "/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" "/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/il2cppOutput/il2cppOutput"

    stdout;
    IL2CPP error for method 'System.Void BattleInput::RegisterEnchantmentUsed(EEnchantment)' in assembly '/Users/ugc-imac/Projects/BattleTower/Version 2.81RC DEV_U4.6/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
    Additional information: Build a development build for more information. Operation is not valid due to the current state of the object
    stderr:

    Unhandled Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object
    at System.Linq.Enumerable.Single[TypeReference] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
    at System.Linq.Enumerable.Single[TypeReference] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.StackAnalysis.StackAnalysis.ComputeType (Unity.IL2CPP.StackAnalysis.Entry entry) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.StackAnalysis.StackAnalysis+<ComputeGlobalVariables>c__AnonStorey39.<>m__E2 (Unity.IL2CPP.StackAnalysis.Entry item) [0x00000] in <filename unknown>:0
    at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator27`2[Unity.IL2CPP.StackAnalysis.Entry,Unity.IL2CPP.StackAnalysis.GlobalVariable].MoveNext () [0x00000] in <filename unknown>:0
    at System.Collections.Generic.List`1[Unity.IL2CPP.StackAnalysis.GlobalVariable].AddEnumerable (IEnumerable`1 enumerable) [0x00000] in <filename unknown>:0
    at System.Collections.Generic.List`1[Unity.IL2CPP.StackAnalysis.GlobalVariable].AddRange (IEnumerable`1 collection) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.StackAnalysis.StackAnalysis.ComputeGlobalVariables () [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.StackAnalysis.StackAnalysis.get_Globals () [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.MethodBodyWriter.Generate () [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.MethodWriter.WriteMethodBody (Mono.Cecil.MethodReference method) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.MethodWriter.WriteMethod (Mono.Cecil.MethodReference method, MethodWriteMode mode) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.MethodWriter.WriteMethodAndWrappers (Mono.Cecil.MethodReference method, MethodWriteMode mode) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.MethodWriter.WriteMethodDefinitions (System.Func`2 filter) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.SourceWriter.WriteMethodDefinitionsFor (Unity.IL2CPP.CppCodeWriter writer, System.Func`2 filter, Mono.Cecil.TypeReference type, Unity.IL2CPP.Metadata.VTableBuilder vTableBuilder, Mono.Cecil.AssemblyDefinition mscorlib, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.SourceWriter.WriteSource (Unity.IL2CPP.CppCodeWriter writer, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, Mono.Cecil.TypeReference type, System.Collections.Generic.HashSet`1 emptyTypes, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.SourceWriter.WriteSourceFiles (System.String outputDirectory, System.String fileName, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, IEnumerable`1 typeList, System.Collections.Generic.HashSet`1 emptyTypes, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.SourceWriter.Write (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, System.String outputDir, Mono.Cecil.TypeDefinition[] typeList, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.AssemblyConverter.Convert (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics) [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.AssemblyConverter.Apply () [0x00000] in <filename unknown>:0
    at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies (System.String[] assemblies, System.String outputDir) [0x00000] in <filename unknown>:0

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String)
    UnityEditorInternal.IL2CPPBuilder:Run()
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
    UnityEditor.HostView:OnGUI()


    I'm looking forward to the arrival of the reply。
     
  2. bigTree

    bigTree

    Joined:
    Jul 24, 2014
    Posts:
    6
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,747
    This is not an error that we have seen before with IL2CPP. Looking at the IL2CPP code, it seems that this exception could occur in a few places. Can you submit a bug along with the project that reproduces the issue? That will give us the best opportunity to correct it. Thanks.