- Home /
il2cpp android build error unity 2019.1.6f1
Hi guys,
I have been trying to build a 64 bit version of my app for android with il2cpp but it keeps on failing. I am desperate for help. Please help me out. Thanks a lot. This is the first error:
Failed running D:\2019.1.6f1\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="D:\Unity Projects\Trivia Game\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="D:\Unity Projects\Trivia Game\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="D:/2019.1.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --profiler-report --map-file-parser=D:/2019.1.6f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe --directory="D:/Unity Projects/Trivia Game/Temp/StagingArea/assets/bin/Data/Managed" --generatedcppdir="D:/Unity Projects/Trivia Game/Temp/StagingArea/Il2Cpp/il2cppOutput"
stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: D:\Unity Projects\Trivia Game\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
Cache directory: D:\Unity Projects\Trivia Game\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
ObjectFiles: 204 of which compiled: 46
Time Compile: 13662 milliseconds Il2CppAttributes.cpp
Time Compile: 11146 milliseconds Il2CppInvokerTable.cpp
Time Compile: 7403 milliseconds Generics3.cpp
Time Compile: 7167 milliseconds GenericMethods.cpp
Time Compile: 6615 milliseconds Generics.cpp
Time Compile: 6467 milliseconds Generics9.cpp
Time Compile: 6404 milliseconds Generics4.cpp
Time Compile: 6378 milliseconds Generics5.cpp
Time Compile: 6021 milliseconds Generics1.cpp
Time Compile: 6019 milliseconds Generics6.cpp
Total compilation time: 17341 milliseconds.
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\SavaGhost\AppData\Local\Temp\tmp9F72.tmp" -o "D:\Unity Projects\Trivia Game\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_FCA46C92942984C7A2611287D363023A\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-16\arch-arm" -gcc-toolchain "D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -llog -rdynamic -fuse-ld=gold.exe
D:\Unity Projects\Trivia Game\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:36692: error: undefined reference to 'openPage'
D:\Unity Projects\Trivia Game\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:36692: error: undefined reference to 'openPage'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
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: Unity.IL2CPP.Building.BuilderFailedException: D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\SavaGhost\AppData\Local\Temp\tmp9F72.tmp" -o "D:\Unity Projects\Trivia Game\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_FCA46C92942984C7A2611287D363023A\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-16\arch-arm" -gcc-toolchain "D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "D:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -llog -rdynamic -fuse-ld=gold.exe
D:\Unity Projects\Trivia Game\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:36692: error: undefined reference to 'openPage'
D:\Unity Projects\Trivia Game\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:36692: error: undefined reference to 'openPage'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
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)
UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:496)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(String, String, String, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:477)
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)
This is the second bug:
Exception: D:\2019.1.6f1\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:130)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:496)
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:477)
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.Action`1[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 <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4132c5c2cd7b45b09ef33302ae416489>: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 <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <4132c5c2cd7b45b09ef33302ae416489>: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)
This is the third error:
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Answer by JoshPeterson · Jun 17, 2019 at 11:52 AM
The key part of this error message is:
D:\Unity Projects\Trivia Game\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:36692: error: undefined reference to 'openPage'
This means you have some function named openPage
which is an extern
function in C# code. It requires a native implementation. It looks like you don't have a native library for Android which implements this function. So you can either remove the C# code which declares it or provide a native implementation for Android.
this was exactly my issue. I had a function that returned a value on android but on iOS it was calling a native function:
[DllImport("internal")]
public static int iOSnativeFunc();
I wrapped this code between preprocessor directives so it would only compile on iOS and not on Android:
#if UNITY_IOS
[DllImport ("__Internal")] //or something, don't remember exactly
public static int iOSnativeFunc();
#endif
sorry I might not have the keywords right, I'm typing from my phone.
Answer by BlackMustang · Jun 20, 2019 at 07:21 AM
I have nearly the same can you help me: Failed running C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\il2cpp/build/il2cpp.exe --compile-cpp --libil2cpp-static --platform="Android" --architecture="x86" --configuration="Release" --outputpath="C:\Black Monster\Temp\StagingArea\assets\bin\Data\Native\x86\libil2cpp.so" --cachedirectory="C:\Black Monster\Assets..\Library\il2cpp_android_x86/il2cpp_cache" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.2.0b6/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.2.0b6/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2019.2.0b6/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.2.0b6/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --generatedcppdir="C:/Black Monster/Temp/StagingArea/Il2Cpp/il2cppOutput" --dotnetprofile="unityaot"
stdout: Building libil2cpp.so with AndroidToolChain Output directory: C:\Black Monster\Temp\StagingArea\assets\bin\Data\Native\x86 Cache directory: C:\Black Monster\Library\il2cpp_android_x86\il2cpp_cache ObjectFiles: 208 of which compiled: 0 Total compilation time: 188 milliseconds. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\phili\AppData\Local\Temp\tmp36EC.tmp" -o "C:\Black Monster\Library\il2cpp_android_x86\il2cpp_cache\linkresult_7742B5A8F8E2324A5B48ADCBF27528B6\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-16\arch-x86" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\x86-4.9\prebuilt\windows-x86_64" -target i686-none-linux-android -Wl,--wrap,sigaction -L "C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\x86" -lgnustl_static -llog -rdynamic -fuse-ld=gold.exe
C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\include\bits/atomic_base.h:503: error: undefined reference to '__atomic_load_8' C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\include\bits/atomic_base.h:427: error: undefined reference to '__atomic_fetch_add_8' C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\include\bits/atomic_base.h:411: error: undefined reference to '__atomic_fetch_add_8' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
bei Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext) 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) stderr:
Unbehandelte Ausnahme: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\phili\AppData\Local\Temp\tmp36EC.tmp" -o "C:\Black Monster\Library\il2cpp_android_x86\il2cpp_cache\linkresult_7742B5A8F8E2324A5B48ADCBF27528B6\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-16\arch-x86" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\x86-4.9\prebuilt\windows-x86_64" -target i686-none-linux-android -Wl,--wrap,sigaction -L "C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\x86" -lgnustl_static -llog -rdynamic -fuse-ld=gold.exe
C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\include\bits/atomic_base.h:503: error: undefined reference to '__atomic_load_8' C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\include\bits/atomic_base.h:427: error: undefined reference to '__atomic_fetch_add_8' C:\Program Files\Unity\Hub\Editor\2019.2.0b6\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\include\bits/atomic_base.h:411: error: undefined reference to '__atomic_fetch_add_8' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
bei Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext) 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)
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, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71) UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:502) UnityEditorInternal.IL2CPPBuilder:RunCompileAndLink() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:370) UnityEditorInternal.IL2CPPUtils:RunCompileAndLink(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:77) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
This looks like a slightly different issue. It can occur when the x86 architecture is built for Android. If you project does not need to build for x86, just unselect that option in the Player Settings.
If it does need to build for x86, you will need to update to the latest Unity release in the release cycle you are using. This issue has been corrected.
Answer by greyshapeco · Sep 04, 2019 at 06:38 PM
unity 2019.1.6f1 / unity 2019.2.3f1 I had the same error because file path contained another language (and no space in the way to unity (C:\Program Files\Unity - may be errors . C:\Unity - correct)
Answer by Ayushraj · Oct 24, 2019 at 07:21 PM
Hey, I was stucked into same problem , my unity version is 2019.1.2f1 , so i found this way of solving https://www.youtube.com/watch?v=ueRnUVVm3i0
No need to update your unity version.
Thank You that video really Solve my problem at 2018.1.6f1 version related to il2cpp without deleting temp folder of my project........ by running only il2cpp.exe as a ad$$anonymous$$istrator and deleting the cache files of related architecture