Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

il2cpp issues

Discussion in 'Documentation' started by shuang_unity, Jun 5, 2018.

  1. shuang_unity

    shuang_unity

    Joined:
    Jun 4, 2018
    Posts:
    6
    Currently I've built a very simple scene and would like to compile it to test il2cpp functionalities. Il2cpp just could not run correctly whatsoever but the mono compiler works. Below are the error messages.

    Failed running /Applications/Unity/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --compile-cpp --libil2cpp-static --platform="MacOSX" --architecture="x64" --configuration="Release" --outputpath="/private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Temp/StagingArea/Data/Native/GameAssembly.dylib" --cachedirectory="/private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Assets/../Library/il2cpp_cache" --map-file-parser="/Applications/Unity/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --assembly="/private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll" --assembly="/private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Temp/StagingArea/Data/Managed/UnityEngine.Analytics.dll" --assembly="/private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Temp/StagingArea/Data/Managed/UnityEngine.dll" --generatedcppdir="/private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Temp/StagingArea/Data/il2cppOutput"

    stdout:
    Building GameAssembly.dylib with ClangToolChain.
    Output directory: /private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Temp/StagingArea/Data/Native
    Cache directory: /private/var/folders/x6/l7fj6z_x35x08rdq6k11tpf5mtcxt4/T/f3b7dce9bb2ac495f8e8efd7757f9fd6/Library/il2cpp_cache
    il2cpp.exe didn't catch exception: System.InvalidOperationException: Sequence contains no matching element
    at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
    at Unity.IL2CPP.Building.ToolChains.ClangToolChain.<ToolChainIncludePaths>c__Iterator1.MoveNext()
    at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
    at Unity.IL2CPP.Building.Hashing.FileHashProvider.Initialize(IEnumerable`1 cppSourceCompileInstructions)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    stderr:

    Unhandled Exception: System.InvalidOperationException: Sequence contains no matching element
    at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
    at Unity.IL2CPP.Building.ToolChains.ClangToolChain.<ToolChainIncludePaths>c__Iterator1.MoveNext()
    at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
    at Unity.IL2CPP.Building.Hashing.FileHashProvider.Initialize(IEnumerable`1 cppSourceCompileInstructions)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    at Program.Main(String[] args)

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
    UnityEditorInternal.Runner:RunNetCoreProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:79)
    UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:360)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:343)
    UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:162)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:42)
    DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:192)
    DesktopStandalonePostProcessor:postProcess(BuildPostProcessArgs) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:20)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Exception: /Applications/Unity/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll did not run properly!
    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
    UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1 setupStartInfo) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:79)
    UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1 arguments, System.Action`1 setupStartInfo, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:360)
    UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (ICollection`1 userAssemblies, System.String outputDirectory, System.String workingDirectory, Boolean platformSupportsManagedDebugging) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:343)
    UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:162)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action`1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:42)
    DesktopStandalonePostProcessor.SetupStagingArea (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:192)
    DesktopStandalonePostProcessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:20)
    UnityEditor.OSXStandalone.OSXDesktopStandalonePostProcessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/OSXPlayer/Extensions/Managed/OSXDesktopStandalonePostProcessor.cs:233)
    UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:285)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    I've been stuck with this problem for a whole day now. I will really appreciate if somebody could help. Thanks guys!
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    3,380
    The error message in this case is pretty poorly worded. It indicates that Unity cannot locate the Xcode installation on your machine (but you have no way to determine that from the message!). Unity requires that Xcode is installed on the machine at /Applications/Xcode.app in order to complete IL2CPP builds.

    So please install Xcode if it is not installed, or make sure it is at that location.

    Note that we have a significant improvement to this error message on the way to a Unity patch release soon.
     
    shuang_unity likes this.
  3. shuang_unity

    shuang_unity

    Joined:
    Jun 4, 2018
    Posts:
    6
    Thank you so much! My game worked after running XCode today. You've been very helpful!
     
    JoshPeterson likes this.