Problem with Unity 2018.4.24 on Big Sur
Hello everyone! I'm trying to build a project for the Android using Unity 2018.4.24. It is on macOS Big Sur, 11.2.2.
The build crashed with 3 errors associated with IL2CPP. I can't figure out, what's wrong. Please, help me to solve the issue. Many thanks in advance.
The log is the next:
Failed running /Applications/Unity/Hub/Editor/2018.4.24f1/Unity.app/Contents/il2cpp/build/il2cppcore/il2cppcore.dll --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/assets/bin/Data/Native/armeabi-v7a/libil2cpp.so" --cachedirectory="/Volumes/Jenkins/workspace/SShards/Assets/../Library/il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="/Applications/Unity/Hub/Editor/2018.4.24f1/PlaybackEngines/AndroidPlayer/Tools/bdwgc/include" --additional-include-directories="/Applications/Unity/Hub/Editor/2018.4.24f1/PlaybackEngines/AndroidPlayer/Tools/libil2cpp/include" --tool-chain-path="/Applications/android-ndk-r16b" --map-file-parser="/Applications/Unity/Hub/Editor/2018.4.24f1/Unity.app/Contents/Tools/MapFileParser/MapFileParser" --directory="/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/assets/bin/Data/Managed" --generatedcppdir="/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/Il2Cpp/il2cppOutput"
stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: /Volumes/Jenkins/workspace/SShards/Temp/StagingArea/assets/bin/Data/Native/armeabi-v7a
Cache directory: /Volumes/Jenkins/workspace/SShards/Library/il2cpp_android_armeabi-v7a/il2cpp_cache
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException:
Invocation was: Executable: /Applications/android-ndk-r16b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++
Arguments: -DNET_4_0 -DUNITY_AOT -DGC_NOT_DLL -DRUNTIME_IL2CPP -DLINUX -DANDROID -DPLATFORM_ANDROID -D__linux__ -D__STDC_FORMAT_MACROS -I"/Applications/Unity/Hub/Editor/2018.4.24f1/PlaybackEngines/AndroidPlayer/Tools/bdwgc/include" -I"/Applications/Unity/Hub/Editor/2018.4.24f1/PlaybackEngines/AndroidPlayer/Tools/libil2cpp/include" -I"/Volumes/Jenkins/Applications/Unity/Hub/Editor/2018.4.24f1/Unity.app/Contents/il2cpp/libil2cpp" -I"/Volumes/Jenkins/Applications/Unity/Hub/Editor/2018.4.24f1/Unity.app/Contents/il2cpp/external/boehmgc/include" -I"/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/Il2Cpp/il2cppOutput" -I"." -I"/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include" -I"/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/backward" -I"/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include" -c -g -DNDEBUG -funwind-tables -fno-limit-debug-info -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++98 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -fPIC -Os --sysroot "/Applications/android-ndk-r16b/sysroot" -gcc-toolchain "/Applications/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64" -target armv7-none-linux-androideabi -isystem "/Applications/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi" -D__ANDROID_API__=16 -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 -Wno-unused-value "/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/Il2Cpp/il2cppOutput/Il2CppTypeDefinitions.cpp" -o "/Volumes/Jenkins/workspace/SShards/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/8976BF78699569E7F2F00E1DDF3F3506.o"
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
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:
Invocation was: Executable: /Applications/android-ndk-r16b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++
Arguments: -DNET_4_0 -DUNITY_AOT -DGC_NOT_DLL -DRUNTIME_IL2CPP -DLINUX -DANDROID -DPLATFORM_ANDROID -D__linux__ -D__STDC_FORMAT_MACROS -I"/Applications/Unity/Hub/Editor/2018.4.24f1/PlaybackEngines/AndroidPlayer/Tools/bdwgc/include" -I"/Applications/Unity/Hub/Editor/2018.4.24f1/PlaybackEngines/AndroidPlayer/Tools/libil2cpp/include" -I"/Volumes/Jenkins/Applications/Unity/Hub/Editor/2018.4.24f1/Unity.app/Contents/il2cpp/libil2cpp" -I"/Volumes/Jenkins/Applications/Unity/Hub/Editor/2018.4.24f1/Unity.app/Contents/il2cpp/external/boehmgc/include" -I"/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/Il2Cpp/il2cppOutput" -I"." -I"/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include" -I"/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/backward" -I"/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include" -c -g -DNDEBUG -funwind-tables -fno-limit-debug-info -fdata-sections -ffunction-sections -Wa,--noexecstack -fno-rtti -std=c++98 -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-overflow -fPIC -Os --sysroot "/Applications/android-ndk-r16b/sysroot" -gcc-toolchain "/Applications/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64" -target armv7-none-linux-androideabi -isystem "/Applications/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi" -D__ANDROID_API__=16 -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 -Wno-unused-value "/Volumes/Jenkins/workspace/SShards/Temp/StagingArea/Il2Cpp/il2cppOutput/Il2CppTypeDefinitions.cpp" -o "/Volumes/Jenkins/workspace/SShards/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/8976BF78699569E7F2F00E1DDF3F3506.o"
at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
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:374)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(String, String, String, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:357)
UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:35)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
Comment
I've solved the issue with the next actions:
delete android-ndk-r16b and download it once again (it seems something has been changed in the ndk since I downloaded it previous time)
updated permissions in the android-ndk-r16b folder as it is described in https://forum.unity.com/threads/clang-cannot-be-opened.759941/