IL2CPP build error

Hi there,

I know that this kind of issue has been the topic before but I could not solve my problems so far therefore my question here:

I have built an AR app for Android which got built as an app bundle without any problems for Mono/32 bit using Unity version 2019.2.14f1. Now that I changed to IL2CPP because of Google’s restriction to 64 bit architecture, the build fails at “building native binary with IL2CPP”. In the Player settings the options ARMv7 and ARM64 are checked. The SDK, NDK and JDK are each installed with Unity as recommended.

The error logs are as follows;

Error 1
Failed running C:\Program Files\Unity\Hub\Editor\2019.2.14f1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile=“unityaot” --compile-cpp --libil2cpp-static --platform=“Android” --architecture=“ARMv7” --configuration=“Release” --outputpath=“C:\Unity-Projekte\Demo Scale\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so” --cachedirectory=“C:\Unity-Projekte\Demo Scale\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache” --additional-include-directories=“C:/Program Files/Unity/Hub/Editor/2019.2.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include” --additional-include-directories=“C:/Program Files/Unity/Hub/Editor/2019.2.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include” --tool-chain-path=“C:/Program Files/Unity/Hub/Editor/2019.2.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK” --profiler-report --map-file-parser=“C:/Program Files/Unity/Hub/Editor/2019.2.14f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe” --directory=“C:/Unity-Projekte/Demo Scale/Temp/StagingArea/assets/bin/Data/Managed” --generatedcppdir=“C:/Unity-Projekte/Demo Scale/Temp/StagingArea/Il2Cpp/il2cppOutput”

stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: C:\Unity-Projekte\Demo Scale\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
Cache directory: C:\Unity-Projekte\Demo Scale\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
il2cpp.exe didn’t catch exception: System.AggregateException: Mindestens ein Fehler ist aufgetreten. —> System.ComponentModel.Win32Exception: Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_02.<RunWithResult>b__0(Object o) --- Ende der internen Ausnahmestapel�berwachung --- bei Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[ ] data, Func2 action)
bei Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector) bei Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics) bei il2cpp.Program.DoRun(String[ ] args) bei il2cpp.Program.Run(String[ ] args) bei il2cpp.Program.Main(String[ ] args) ---> (Interne Ausnahme #0) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller) bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data) bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_02.b__0(Object o)<—
—> (Interne Ausnahme #1) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
—> (Interne Ausnahme #6) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o)<—

—> (Interne Ausnahme #7) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o)<—

stderr:

Unbehandelte Ausnahme: System.AggregateException: Mindestens ein Fehler ist aufgetreten. —> System.ComponentModel.Win32Exception: Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_02.<RunWithResult>b__0(Object o) --- Ende der internen Ausnahmestapel�berwachung --- bei Unity.IL2CPP.Building.ParallelFor.RunWithResult[D,T](D[ ] data, Func2 action)
bei Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
bei Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
bei il2cpp.Program.DoRun(String[ ] args)
bei il2cpp.Program.Run(String[ ] args)
bei il2cpp.Program.Main(String[ ] args)

bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o)<—

—> (Interne Ausnahme #2) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o)<—

—> (Interne Ausnahme #3) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o)<—

—> (Interne Ausnahme #4) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o)<—

—> (Interne Ausnahme #5) System.ComponentModel.Win32Exception (0x80004005): Das System kann die angegebene Datei nicht finden
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
bei Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data)
bei Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_02.<RunWithResult>b__0(Object o)<--- UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:126) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71)
UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List1, Action1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:503)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(String, String, String, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:484)
UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Error 2:
Exception: C:\Program Files\Unity\Hub\Editor\2019.2.14f1\Editor\Data\il2cpp/build/il2cpp.exe 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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1[T] arguments, System.Action1[T] setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:503) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.String inputDirectory, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:484) UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

The German phrase “Das System kann die angegebene Datei nicht finden” means that a specific file cannot be found. Unfortunately I have not the faintest idea what to do with that information.
Does anybody have an idea?

Best regards
Eva

This can happen for a few reasons. First, check for non-ASCII characters in the path to your project and the Android NDK installation path. The Android NDK often fails when non-ASCII characters are used in the path. Second, you might need to shorten the installation location of the Android NDK. On Windows, the Unity Hub will sometimes install the Android NDK in a path that will exceed the maximum path length. You can manually install the Android NDK in a shorter path and point the Unity editor to it.

You can find details about the Android NDK installation here: https://docs.unity3d.com/Manual/android-sdksetup.html

Hi Josh,
thanks for your quick help. I will try these alternatives - will get back to you soon!