Exception: C:\Program Files\Unity\Hub\Editor\2019.2.9f1\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.List
1[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.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 <24d9b022aa584914af833273ea899103>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <24d9b022aa584914af833273ea899103>: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 <24d9b022aa584914af833273ea899103>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <24d9b022aa584914af833273ea899103>: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)
Android build not building:
First, make a blank project with a single blank scene and prove that it builds successfully.
If it does NOT build, then go fix your Unity installation, or your other tools, such as Android SDK, NDK, JDK, etc.
Until you can build a blank project to the target platform, don’t fiddle with anything else.
Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.
Most often things that prevent building are third-party libraries such as Firebase.
Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.
It may also be helpful to work through a tutorial or two for that subsystem.
Hi, thanks for your help. Btw, I’m quite new to Unity. Not sure if the test below is valid.
I have another app using the same unity version 2019.2.9f1 and same jdk, sdk, ndk. I am able to build successfully.
More information: I have upgraded this error app from 2017.4.21f1 to 2019.2.9f1. I was able to build it using Mono from 2017.4.21f1. But google require us to use arm64 which I need to change to il2cpp. After changing to il2cpp, I can’t built. So now I tried to upgrade to 2019.2.9f1 but still face issue. I also encountered errors below:
Failed running C:\Program Files\Unity\Hub\Editor\2019.2.9f1\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:\GT\Happy Juice\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so” --cachedirectory=“D:\GT\Happy Juice\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache” --additional-include-directories=“C:/Program Files/Unity/Hub/Editor/2019.2.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include” --additional-include-directories=“C:/Program Files/Unity/Hub/Editor/2019.2.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include” --tool-chain-path=“C:/Program Files/Unity/Hub/Editor/2019.2.9f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK” --profiler-report --map-file-parser=“C:/Program Files/Unity/Hub/Editor/2019.2.9f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe” --directory=“D:/GT/Happy Juice/Temp/StagingArea/assets/bin/Data/Managed” --generatedcppdir=“D:/GT/Happy Juice/Temp/StagingArea/Il2Cpp/il2cppOutput”
stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: D:\GT\Happy Juice\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
Cache directory: D:\GT\Happy Juice\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
ObjectFiles: 209 of which compiled: 0
Total compilation time: 411 milliseconds.
il2cpp.exe didn’t catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @“C:\Users\GT\AppData\Local\Temp\tmp119.tmp” -o “D:\GT\Happy Juice\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_F921403DEE099E5CD9D83780E8D161A3\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.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-16\arch-arm” -gcc-toolchain “C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64” -target armv7-none-linux-androideabi -Wl,–wrap,sigaction -L “C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a” -lgnustl_static -latomic -llog -rdynamic -fuse-ld=gold.exe
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27075: error: undefined reference to ‘IOSInit’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27101: error: undefined reference to ‘IOSLogInWithReadPermissions’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27101: error: undefined reference to ‘IOSLogInWithReadPermissions’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27119: error: undefined reference to ‘IOSLogInWithPublishPermissions’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27119: error: undefined reference to ‘IOSLogInWithPublishPermissions’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27133: error: undefined reference to ‘IOSLogOut’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27133: error: undefined reference to ‘IOSLogOut’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27143: error: undefined reference to ‘IOSSetShareDialogMode’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27143: error: undefined reference to ‘IOSSetShareDialogMode’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27169: error: undefined reference to ‘IOSShareLink’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27223: error: undefined reference to ‘IOSFeedShare’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27319: error: undefined reference to ‘IOSAppRequest’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27387: error: undefined reference to ‘IOSAppInvite’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27417: error: undefined reference to ‘IOSCreateGameGroup’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27443: error: undefined reference to ‘IOSJoinGameGroup’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27443: error: undefined reference to ‘IOSJoinGameGroup’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27461: error: undefined reference to ‘IOSFBSettingsActivateApp’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27461: error: undefined reference to ‘IOSFBSettingsActivateApp’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27513: error: undefined reference to ‘IOSFBAppEventsLogEvent’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27591: error: undefined reference to ‘IOSFBAppEventsLogPurchase’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27631: error: undefined reference to ‘IOSFBAppEventsSetLimitEventUsage’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27631: error: undefined reference to ‘IOSFBAppEventsSetLimitEventUsage’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27641: error: undefined reference to ‘IOSGetAppLink’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27641: error: undefined reference to ‘IOSGetAppLink’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27651: error: undefined reference to ‘IOSFBSdkVersion’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27651: error: undefined reference to ‘IOSFBSdkVersion’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27670: error: undefined reference to ‘IOSFetchDeferredAppLink’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27670: error: undefined reference to ‘IOSFetchDeferredAppLink’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27680: error: undefined reference to ‘IOSRefreshCurrentAccessToken’
D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27680: error: undefined reference to ‘IOSRefreshCurrentAccessToken’
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet1 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: C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\GT\AppData\Local\Temp\tmp119.tmp" -o "D:\GT\Happy Juice\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_F921403DEE099E5CD9D83780E8D161A3\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.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-16\arch-arm" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -Wl,--wrap,sigaction -L "C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -latomic -llog -rdynamic -fuse-ld=gold.exe D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27075: error: undefined reference to 'IOSInit' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27101: error: undefined reference to 'IOSLogInWithReadPermissions' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27101: error: undefined reference to 'IOSLogInWithReadPermissions' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27119: error: undefined reference to 'IOSLogInWithPublishPermissions' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27119: error: undefined reference to 'IOSLogInWithPublishPermissions' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27133: error: undefined reference to 'IOSLogOut' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27133: error: undefined reference to 'IOSLogOut' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27143: error: undefined reference to 'IOSSetShareDialogMode' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27143: error: undefined reference to 'IOSSetShareDialogMode' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27169: error: undefined reference to 'IOSShareLink' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27223: error: undefined reference to 'IOSFeedShare' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27319: error: undefined reference to 'IOSAppRequest' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27387: error: undefined reference to 'IOSAppInvite' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27417: error: undefined reference to 'IOSCreateGameGroup' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27443: error: undefined reference to 'IOSJoinGameGroup' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27443: error: undefined reference to 'IOSJoinGameGroup' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27461: error: undefined reference to 'IOSFBSettingsActivateApp' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27461: error: undefined reference to 'IOSFBSettingsActivateApp' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27513: error: undefined reference to 'IOSFBAppEventsLogEvent' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27591: error: undefined reference to 'IOSFBAppEventsLogPurchase' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27631: error: undefined reference to 'IOSFBAppEventsSetLimitEventUsage' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27631: error: undefined reference to 'IOSFBAppEventsSetLimitEventUsage' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27641: error: undefined reference to 'IOSGetAppLink' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27641: error: undefined reference to 'IOSGetAppLink' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27651: error: undefined reference to 'IOSFBSdkVersion' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27651: error: undefined reference to 'IOSFBSdkVersion' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27670: error: undefined reference to 'IOSFetchDeferredAppLink' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27670: error: undefined reference to 'IOSFetchDeferredAppLink' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27680: error: undefined reference to 'IOSRefreshCurrentAccessToken' D:\GT\Happy Juice\Temp\StagingArea\Il2Cpp\il2cppOutput/Facebook.Unity.cpp:27680: error: undefined reference to 'IOSRefreshCurrentAccessToken' 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:126)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71) UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List
1, 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)
Excellent. Now grossly work between the two to find what is different.
First place I would look is the Facebook junk: it appears that it is attempting to us iOS methods even though you report you are building for Android. That will never work.