I’ve been working on this all day and I can’t find a solution.
I’m using XCode 15 and iOS 17, and Unity Editor Version 2022.3.6f1.
After switching an EMPTY Unity Project to the iOS platform and then building it into a folder to run into XCode, XCode fails to build it, giving an error:
Command PhaseScriptExecution failed with a nonzero exit code
This is the full log:
Showing Recent Issues
Build target UnityFramework of project Unity-iPhone with configuration ReleaseForRunning
/Users/max/Desktop/flarpy borb xcode/Unity-iPhone.xcodeproj: warning: Ignoring ENABLE_BITCODE because building with bitcode is no longer supported. (in target 'UnityFramework' from project 'Unity-iPhone')
/Users/max/Desktop/flarpy borb xcode/Unity-iPhone.xcodeproj: Ignoring ENABLE_BITCODE because building with bitcode is no longer supported.
Build target Unity-iPhone of project Unity-iPhone with configuration ReleaseForRunning
/Users/max/Desktop/flarpy borb xcode/Unity-iPhone.xcodeproj: warning: Ignoring ENABLE_BITCODE because building with bitcode is no longer supported. (in target 'Unity-iPhone' from project 'Unity-iPhone')
/Users/max/Desktop/flarpy borb xcode/Unity-iPhone.xcodeproj: Ignoring ENABLE_BITCODE because building with bitcode is no longer supported.
Build target GameAssembly of project Unity-iPhone with configuration ReleaseForRunning
/Users/max/Desktop/flarpy borb xcode/Unity-iPhone.xcodeproj: warning: Ignoring ENABLE_BITCODE because building with bitcode is no longer supported. (in target 'GameAssembly' from project 'Unity-iPhone')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'GameAssembly' from project 'Unity-iPhone')
/Users/max/Desktop/flarpy borb xcode/Unity-iPhone.xcodeproj: Ignoring ENABLE_BITCODE because building with bitcode is no longer supported.
Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
PhaseScriptExecution Run Script /Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/GameAssembly.build/Script-C62A2A42F32E085EF849CF0B.sh (in target 'GameAssembly' from project 'Unity-iPhone')
cd /Users/max/Desktop/flarpy borb xcode
[lots of exporting]
/bin/sh -c /Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/GameAssembly.build/Script-C62A2A42F32E085EF849CF0B.sh
/Users/max/Desktop/flarpy borb xcode/Il2CppOutputProject/IL2CPP/build/deploy_arm64/il2cpp --compile-cpp --platform=iOS --baselib-directory=/Users/max/Desktop/flarpy borb xcode/Libraries --additional-defines=IL2CPP_DEBUG=0 --incremental-g-c-time-slice=3 --dotnetprofile=unityaot-macos --profiler-report --print-command-line --external-lib-il2-cpp=/Users/max/Desktop/flarpy borb xcode/Libraries/libil2cpp.a --generatedcppdir=Il2CppOutputProject/Source/il2cppOutput --architecture=arm64 --outputpath=/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Products/ReleaseForRunning-iphoneos/libGameAssembly.a --cachedirectory=/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64 --configuration=Release
Starting: /Users/max/Desktop/flarpy borb xcode/Il2CppOutputProject/IL2CPP/build/deploy_arm64/bee_backend/mac-arm64/bee_backend --profile="/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64/buildstate/backend_profiler0.traceevents" --beedriver-listener --dagfile="/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64/buildstate/bee.dag" --continue-on-failure FinalProgram
WorkingDir: /Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64/buildstate
ExitCode: 4 Duration: 0s153ms
ExitCode: 1 Duration: 0s2ms
Build failed with 0 successful nodes and 0 failed ones
Error: Internal build system error. BuildProgram exited with code 1.
Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Mac, you must have Xcode installed.
Building for Apple Silicon requires Xcode 9.4 and Mac 10.12 SDK.
Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select.
It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements.
More information and installation instructions can be found here:
https://developer.apple.com/support/xcode/
Specific Xcode versions can be downloaded here:
https://developer.apple.com/download/more/
Unable to detect any compatible iPhoneOS SDK!
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.GetCompatibleXcodeInstallation(Architecture architecture, Version xcodeMinVersion, Version platformSdkMinVersion, Identifier platformSdkIdentifier, XcodePlatformSdk& compatiblePlatformSdk, XcodeInstallation& compatibleXcodeInstallation)
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.UserAvailableToolchainFor(Architecture architecture, NPath toolChainPath, NPath sysRootPath)
at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory)
at Unity.IL2CPP.Building.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/InProcessBuildProgram.cs:line 51
Error: Unity.IL2CPP.Building.BuilderFailedException: Build failed with 0 successful nodes and 0 failed ones
Error: Internal build system error. BuildProgram exited with code 1.
Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Mac, you must have Xcode installed.
Building for Apple Silicon requires Xcode 9.4 and Mac 10.12 SDK.
Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select.
It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements.
More information and installation instructions can be found here:
https://developer.apple.com/support/xcode/
Specific Xcode versions can be downloaded here:
https://developer.apple.com/download/more/
Unable to detect any compatible iPhoneOS SDK!
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.GetCompatibleXcodeInstallation(Architecture architecture, Version xcodeMinVersion, Version platformSdkMinVersion, Identifier platformSdkIdentifier, XcodePlatformSdk& compatiblePlatformSdk, XcodeInstallation& compatibleXcodeInstallation)
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.UserAvailableToolchainFor(Architecture architecture, NPath toolChainPath, NPath sysRootPath)
at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory)
at Unity.IL2CPP.Building.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/InProcessBuildProgram.cs:line 51
at il2cpp.Program.DoRun(TinyProfiler2 tinyProfiler, String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Program.cs:line 319
Command PhaseScriptExecution failed with a nonzero exit code
/Users/max/Desktop/flarpy borb xcode/Il2CppOutputProject/IL2CPP/build/deploy_arm64/il2cpp --compile-cpp --platform=iOS --baselib-directory=/Users/max/Desktop/flarpy borb xcode/Libraries --additional-defines=IL2CPP_DEBUG=0 --incremental-g-c-time-slice=3 --dotnetprofile=unityaot-macos --profiler-report --print-command-line --external-lib-il2-cpp=/Users/max/Desktop/flarpy borb xcode/Libraries/libil2cpp.a --generatedcppdir=Il2CppOutputProject/Source/il2cppOutput --architecture=arm64 --outputpath=/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Products/ReleaseForRunning-iphoneos/libGameAssembly.a --cachedirectory=/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64 --configuration=Release
Starting: /Users/max/Desktop/flarpy borb xcode/Il2CppOutputProject/IL2CPP/build/deploy_arm64/bee_backend/mac-arm64/bee_backend --profile="/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64/buildstate/backend_profiler0.traceevents" --beedriver-listener --dagfile="/Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64/buildstate/bee.dag" --continue-on-failure FinalProgram
WorkingDir: /Users/max/Library/Developer/Xcode/DerivedData/Unity-iPhone-efmjqelicbltevcfexdwscjgkreh/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/artifacts/arm64/buildstate
ExitCode: 4 Duration: 0s153ms
ExitCode: 1 Duration: 0s2ms
Build failed with 0 successful nodes and 0 failed ones
Error: Internal build system error. BuildProgram exited with code 1.
Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Mac, you must have Xcode installed.
Building for Apple Silicon requires Xcode 9.4 and Mac 10.12 SDK.
Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select.
It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements.
More information and installation instructions can be found here:
https://developer.apple.com/support/xcode/
Specific Xcode versions can be downloaded here:
https://developer.apple.com/download/more/
Unable to detect any compatible iPhoneOS SDK!
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.GetCompatibleXcodeInstallation(Architecture architecture, Version xcodeMinVersion, Version platformSdkMinVersion, Identifier platformSdkIdentifier, XcodePlatformSdk& compatiblePlatformSdk, XcodeInstallation& compatibleXcodeInstallation)
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.UserAvailableToolchainFor(Architecture architecture, NPath toolChainPath, NPath sysRootPath)
at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory)
at Unity.IL2CPP.Building.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/InProcessBuildProgram.cs:line 51
Error: Unity.IL2CPP.Building.BuilderFailedException: Build failed with 0 successful nodes and 0 failed ones
Error: Internal build system error. BuildProgram exited with code 1.
Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Mac, you must have Xcode installed.
Building for Apple Silicon requires Xcode 9.4 and Mac 10.12 SDK.
Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select.
It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements.
More information and installation instructions can be found here:
https://developer.apple.com/support/xcode/
Specific Xcode versions can be downloaded here:
https://developer.apple.com/download/more/
Unable to detect any compatible iPhoneOS SDK!
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.GetCompatibleXcodeInstallation(Architecture architecture, Version xcodeMinVersion, Version platformSdkMinVersion, Identifier platformSdkIdentifier, XcodePlatformSdk& compatiblePlatformSdk, XcodeInstallation& compatibleXcodeInstallation)
at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.UserAvailableToolchainFor(Architecture architecture, NPath toolChainPath, NPath sysRootPath)
at Unity.IL2CPP.Bee.IL2CPPExeCompileCppBuildProgram.BuildProgram.Main(String[] args, String currentDirectory)
at Unity.IL2CPP.Building.InProcessBuildProgram.StartImpl(String workingDirectory, String[] arguments) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/InProcessBuildProgram.cs:line 51
at il2cpp.Program.DoRun(TinyProfiler2 tinyProfiler, String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Program.cs:line 319
Command PhaseScriptExecution failed with a nonzero exit code
Build failed 8/11/23, 2:53 PM 6.2 seconds
I do have a phone connected running iOS 17:
And in the applications folder, I renamed "XCode-Beta" to just XCode"
Run Script:
HOST_ARCH=$(uname -m)
IL2CPP_DIR="$PROJECT_DIR/Il2CppOutputProject/IL2CPP/build/deploy_$HOST_ARCH"
IL2CPP="$IL2CPP_DIR/il2cpp"
chmod +x "$IL2CPP"
if [ "$HOST_ARCH" = "arm64" ];
then
HOST_ARCH_BEE="arm64"
else
HOST_ARCH_BEE="x64"
fi
chmod +x "$IL2CPP_DIR/bee_backend/mac-$HOST_ARCH_BEE/bee_backend"
if [ "$CONFIGURATION" = "Debug" ];
then
IL2CPP_CONFIG="Debug"
else
IL2CPP_CONFIG="Release"
fi
"$IL2CPP" --compile-cpp --platform=iOS --baselib-directory="$PROJECT_DIR/Libraries" --additional-defines=IL2CPP_DEBUG=0 --incremental-g-c-time-slice=3 --dotnetprofile=unityaot-macos --profiler-report --print-command-line --external-lib-il2-cpp="$PROJECT_DIR/Libraries/libil2cpp.a" --generatedcppdir="Il2CppOutputProject/Source/il2cppOutput" --architecture=arm64 --outputpath="$CONFIGURATION_BUILD_DIR/libGameAssembly.a" --cachedirectory="$CONFIGURATION_TEMP_DIR/artifacts/arm64" --configuration="$IL2CPP_CONFIG"
Changing ‘for install builds only’ only gives more errors.
I would really appreciate any help.
2
Answers
Rolling back to Xcode 15 Beta 5 fixed this for me.
Did you find any solution to your issue? I am having the same issue as my targeted platform is vision OS.
Any help would be recommended!