I'm trying to optimize using the Burst Compiler on an iOS device. The Unity version is 2020.3.48f1, and the Burst Compiler version is 1.6.6 During iOS build, I'm encounting the following error.
If anyone knows how to resolve it, pleas help.
Error Log
BuildFailedException: Burst compiler (1.6.6) failed running
stdout:
Overriding backend due to platform constraints : 'burst-llvm-10'
Failed to determine iphoneos sdk installation path - /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk does not exist, and "xcrun --sdk iphoneos --show-sdk-path" failed with xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
Error building Player: BuildFailedException: Burst compiler (1.6.6) failed running
stdout:
Overriding backend due to platform constraints : 'burst-llvm-10'
Failed to determine iphoneos sdk installation path - /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk does not exist, and "xcrun --sdk iphoneos --show-sdk-path" failed with xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
stderr:
Error building Player: 3 errors
You may need to reinstall Visual Studio 2019 or update the Burst Compiler to the latest version (1.8.2 as of now).
Some more digging suggests that you may have an incorrect clang version or a wrong XCode installation path. You can check your clang version by typing clang --version in the terminal and compare it with the minimum required version (12.0.0) by the Burst Compiler.
A similar error was resolved by entering this command in the terminal: sudo xcode-select --switch /Applications/Xcode.app. This will ensure that Unity uses the correct XCode installation path and SDK.
You can also try overriding the backend by adding this line to your Project Settings: Scripting Define Symbols: BURST_BACKEND=burst-llvm-10. This may help if you have an incompatible platform or architecture.
If none of the above solutions work, you may need to contact Unity support or report a bug through the Unity Editor
My sources are as follows:
https://community.gamedev.tv/t/resolved-macos-and-ios-build-using-unity-2022-2-21f1-under-macos-ventura/226740
https://www.bing.com/search?q=Burst+compiler+iOS+build+error&toWww=1&redig=89EF1F110CFB471CB0B329AFF81698D3
https://forum.unity.com/threads/buildfailedexception-burst-compiler-1-8-2-failed-running.1410975/
https://forum.unity.com/threads/solved-buildfailedexception-burst-compiler-1-1-2-failed-running.721793/