Project won't build using Xode15 release candidate

Hi there, just tried to build the project using Xcode15 RC (Released yesterday).
And failed with the following error:

Showing Recent Issues
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, Boolean targetIsSimulator)



   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, Boolean targetIsSimulator)

   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

Building under Xcode15 beta 8 has no issues.
I’m using MacOS 13.5.2, Unity version 2022.3.9

Someone has the same issues?

Do i need to Bug Report?

Thanks.

5 Likes

This looks like a common issue with the Xcode beta. We have discovered it internally as well and are implementing a work around.

2 Likes

Okay, it works now.
What i did:

I’ve installed Xcode RC over the Xcode 14.x as it is not Xcode beta anymore.
Xcode RC not compiling my project due to the errors from above.

Then, i’ve decided to update MacOs to Sonoma, but this doesn’t help.
Then, i’ve removed Xcode RC and any other Xcodes (betas), so my Mac was clean from Xcodes :wink:
Then, i’ve installed the Xcode from AppStore (14.x), but Sonoma won’t open it, as it incompatible.
Then, i’ve downloaded Xcode RC renamed it to XcodeRC, and moved it to the Application folder.
So, i have Application/Xcode and Application/XcodeRC

This time XcodeRC opens and compiles the project.
I think the problem was that i replaced the Xcode 14 with RC. And this breaks something.

Hope this helps someone else.

3 Likes

Just tried installing the Xcode RC as a renamed XcodeRC (skipping all the previous steps you mention), and it did not work for me. Might try a full clean + install later on if I have time, but hopefully they’ll release some kind of patch/news soon. @JoshPeterson

Update: My mistake. Installing a fresh Xcode 15 RC on /Applications/Xcode15RC seems to fix the issue indeed, no need to uninstall the regular Xcode14, and not even other Xcode 15 betas. That being said, it’s kind of messy.

not working for me, using 15RC and getting a completely different compile error, I’m using v2021.3.30, it builds fine in Xcode 14

Is v2021.3 LTS expected to receive Xcode 15 compatibility updates or fixes?

screenshot of the compile error:

I have to remove Xcode as i’ve replaced it with RC at the beginning.

@jason_yak For your problem, you have to add -ld_classic into “Other Linker Flag” in Xcode for the unityframework.
Or, you can do so from Unity itself, by adding the postprocessing script:

public void OnPostprocessBuild(BuildReport report)
        {
            if (report.summary.platform != BuildTarget.iOS)
                return;

            var projectPath = report.summary.outputPath + "/Unity-iPhone.xcodeproj/project.pbxproj";

            var pbxProject = new PBXProject();
            pbxProject.ReadFromFile(projectPath);

          
            //Unity Framework
            target = pbxProject.GetUnityFrameworkTargetGuid();
   
            pbxProject.AddBuildProperty(target, "OTHER_LDFLAGS", "-ld_classic");
            pbxProject.WriteToFile(projectPath);
        }

Hope this helps.

4 Likes

Thanks! I’ll try it… just curious, how did you work this one out? I’ve had a search just now for any info on this flag value and not turning up much.

Answered my own question, found this known issue note… thanks for the clue!

Has anyone hit this warning as well that UnityFramework apparently now needs some entitlements added to it and for that to be possible the target needs to be signed:

UnityFramework isn’t code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it.

I guess we just need to use PBXProject.SetTeamId(), for the framework target GetUnityFrameworkTargetGuid() so it also gets signed?!

Hi Josh, is there an ETA for the fix? It’s currently blocking my app from being released, thank you!

Hi again,

For me, It was enough to set it like this (player settings):

9329708--1305731--sign.png

Hey… so no for me that wasn’t enough, that setting has been on in my projects but the the UnityFramework was not ending up with the team id set. Setting it fixed in post processing and it allows the framework to be signed. I’m freshly generating the xcode project every build too btw. Easy fix though, not sure what accounts for this difference in behaviour.

As a guess perhaps your UnityFramework also doesn’t have the team id set for signing but doesn’t need it to be, my project has various native plugins with different entitlements, there might be something like this which is adding the need for the framework to be signed.

Thank you, unfortunately it didn’t work for me :frowning:

Ok, yesterday, Xcode 15 was officially released, and it was downloaded and updated the Xcode (14.x). This happened out of my control (automatic updates were turned on) and everything stopped working again.
Now, i’ll try to remove all Xcodes once again and install the latest one (15) from scratch.
Hope this will fix this…

Update:
Yes, now nothing works.
Got this same error:

Showing Recent Issues

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.

3 Likes

My Xcode updated overnight and i get this error: command phasescriptexecution failed with a nonzero exit code On a clean project using LTS 2022.3.9f1. Nothing more to the error, no info, nothing to click…
Will try to roll back to an older xcode version for now so i can continue work.

The same problem. Error log:

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:

Specific Xcode versions can be downloaded here:

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, Boolean targetIsSimulator)

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.

  • at Unity.IL2CPP.Bee.BuildLogic.iOS.iOSBuildLogic.GetCompatibleXcodeInstallation…
    Through this error stack, it seems that il2cpp did not find a valid Xcode (even though I have already installed the genuine version of Xcode 15.0).

Hope it can be resolved quickly, I don’t want to repeatedly install Xcode for this problem. :frowning:

2 Likes

It’s now unclear, where to expect a fix or updates.
Coz, i can’t revert back to Xcode 14, as it is not supported by Sonoma.
But i have to make and upload a build but don’t know how…

Finally, I rolled back Xcode to 14.3.1 to start my work.
If your system version is Sonoma, you can download Xcode 14.3.1 and use the following script to make it work on Sonoma.

#!/bin/sh

set -euo pipefail

# Set the paths to your Old/New Xcodes
OLD_XCODE="/Applications/Xcode-14.3.1.app"
NEW_XCODE="/Applications/Xcode.app" # To get build number

# Get New Xcode build number
OLD_XCODE_BUILD=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${OLD_XCODE}/Contents/Info.plist)
NEW_XCODE_BUILD=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${NEW_XCODE}/Contents/Info.plist)

echo The Old Xcode build version is $OLD_XCODE_BUILD
echo The New Xcode build version is $NEW_XCODE_BUILD

# Change Old Xcode build version to New Xcode
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${NEW_XCODE_BUILD}" ${OLD_XCODE}/Contents/Info.plist

# Open Old Xcode (system will check build version and cache it)
open $OLD_XCODE

# Revert Old's Xcode's build version
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${OLD_XCODE_BUILD}" ${OLD_XCODE}/Contents/Info.plist

Ok, thanks.
Btw: I’ve tried to build an Android version, and it won’t build as well. Failed with gradle errors.
Some kind of vicious circle.