il2cpp error when building in arm64 android
I am getting an error whe n trying to build for 64 bit ( now a requierement of android playstore)
and i dont figure out why is it
Error:
Failed running C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\il2cpp/build/il2cpp.exe --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARM64" --configuration="Release" --outputpath="H:\FreeFall\Temp\StagingArea\assets\bin\Data\Native\arm64-v8a\libil2cpp.so" --cachedirectory="H:\FreeFall\Assets\..\Library\il2cpp_android_arm64-v8a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2019.1.12f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.1.12f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --generatedcppdir=H:/FreeFall/Temp/StagingArea/Il2Cpp/il2cppOutput --dotnetprofile="unityaot"
stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: H:\FreeFall\Temp\StagingArea\assets\bin\Data\Native\arm64-v8a
Cache directory: H:\FreeFall\Library\il2cpp_android_arm64-v8a\il2cpp_cache
ObjectFiles: 173 of which compiled: 0
Total compilation time: 221 milliseconds.
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\jacha\AppData\Local\Temp\tmpE77B.tmp" -o "H:\FreeFall\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_EF6EDCCB770919DF9915BF11EFF523DE\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.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-21\arch-arm64" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64" -target aarch64-none-linux-android -Wl,--wrap,sigaction -L "C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\arm64-v8a" -lgnustl_static -llog -rdynamic -fuse-ld=bfd.exe
H:/FreeFall/Library/il2cpp_android_arm64-v8a/il2cpp_cache/8843A5A6A9D3B6F0FE4B7BB33C6447B8.o: file not recognized: File format not recognized
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: C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\jacha\AppData\Local\Temp\tmpE77B.tmp" -o "H:\FreeFall\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_EF6EDCCB770919DF9915BF11EFF523DE\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.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\platforms\android-21\arch-arm64" -gcc-toolchain "C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64" -target aarch64-none-linux-android -Wl,--wrap,sigaction -L "C:\Program Files\Unity\Hub\Editor\2019.1.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\sources\cxx-stl\gnu-libstdc++\4.9\libs\arm64-v8a" -lgnustl_static -llog -rdynamic -fuse-ld=bfd.exe
H:/FreeFall/Library/il2cpp_android_arm64-v8a/il2cpp_cache/8843A5A6A9D3B6F0FE4B7BB33C6447B8.o: file not recognized: File format not recognized
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: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)
Answer by JoshPeterson · Aug 23, 2019 at 10:36 AM
As I mentioned on the forum post, it looks like the IL2CPP build cache is corrupt for some reason. Please try to delete the directory H:/FreeFall/Library/il2cpp_android_arm64-v8a/il2cpp_cache and run the build again.
Omg man u saved me thank u so much u saved me....I searched everywhere, I owe u man <3
Answer by MoryMostafa · Jul 03, 2020 at 12:45 AM
Okay so if you guys have the same problem there's another thing that I want to mention, open your package manager, and go for the packages in your project and make sure that all of them are on the latest version, if they're not you should find a button down there (Instead of "Up to date" you should find "Update to version 1.4.1.0" or something like that,Update it and wait until it imports the new stuff then the "verified ("your unity version")" should appear ..... once u do that do what the answer above me says... good luck everyone !
Your answer
Follow this Question
Related Questions
Failed running il2cpp.exe --platform="Android" --architecture="x86" 1 Answer
Failed running Android build with il2CPP with Unity 2019.2.11f1 2 Answers
il2cpp android build error 2019.2.19f1 1 Answer
Unable to generate 64 bit android apk for Unity project 0 Answers
Why x86 is faster than x86_64 when playing stand alone build? 1 Answer