Since upgrading to Xcode 16.1, when building my game to iOS, it throws the following build fail message on main: unsupported option ‘-mno-thumb’ for target ‘arm64-apple-ios11.0’
Any ideas on how to resolve?
Since upgrading to Xcode 16.1, when building my game to iOS, it throws the following build fail message on main: unsupported option ‘-mno-thumb’ for target ‘arm64-apple-ios11.0’
Any ideas on how to resolve?
NOTE: The issue is also in Xcode 16.0, but was not in 15.x.
I will try to upgrade my Unity project to Unity 6 to see if it exists there as well.
Hi, winnbrian. This looks like it might be a bug. Could you please report it via the Bug Reporter (“Help → Report a Bug…” in the Unity Editor)? Make sure to do it while having your problematic project opened so it gets attached. Cheers!
I’ve encountered the exact same bug, here’s my hackysolution:
OTHER_CFLAGS
or OTHER_LDFLAGS
.-mno-thumb
and remove it.-mno-thumb
in Xcode:Other C Flags
and Other C++ Flags
:Other C Flags
.-mno-thumb
appears.-mno-thumb
from the list.Other C++ Flags
:Cmd+Shift+K
).Thanks for the solution.
If anybody is interested here is my function to automate the removal of this option:
//New XCode doesn't like this build option
[PostProcessBuild]
public static void RemoveThumbOption(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
//1.Load the Xcode project into a PBXProject instance, and get the main target.
var projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
var project = new PBXProject();
project.ReadFromString(File.ReadAllText(projectPath));
var mainTargetGuid = project.GetUnityMainTargetGuid();
//OTHER_CFLAGS
var otherCFlags = project.GetBuildPropertyForAnyConfig(mainTargetGuid, "OTHER_CFLAGS");
if (otherCFlags != null || otherCFlags != "")
{
var newOtherCFlags = otherCFlags.Replace("-mno-thumb", "");
project.SetBuildProperty(mainTargetGuid, "OTHER_CFLAGS", newOtherCFlags);
project.WriteToFile(projectPath);
}
}
}
Post Process Build scripts are new to me. How do you add the Post Process Build script to your Unity Project?
Under Assets create a folder called Editor.
Create a C# file in there.
Copy my function into the file.
The attribute [PostProcessBuild] will ensure it runs the function post build.
" Edit the Exported Xcode Project
OTHER_CFLAGS
or OTHER_LDFLAGS
.-mno-thumb
and remove it."This one worked. Thank you!