Xcode 16.1 Build Failing (unsupported option '-mno-thumb' for target 'arm64-apple-ios11.0'

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:

Edit the Exported Xcode Project

  • Open the Xcode project generated by Unity.
  • In Xcode, navigate to Build Settings and search for OTHER_CFLAGS or OTHER_LDFLAGS.
  • Look for any occurrences of -mno-thumb and remove it.

Steps to Remove -mno-thumb in Xcode:

  1. Locate the Build Settings:
  • Open your project in Xcode.
  • Select your project from the Project Navigator (left-hand side).
  • Choose the Unity-iPhone target.
  1. Search for Other C Flags and Other C++ Flags:
  • Go to the Build Settings tab.
  • In the search bar at the top-right, type Other C Flags.
  • Look for the entries under Custom Compiler Flags as shown in your screenshot.
  1. Edit the Flags:
  • Double-click the entry for each configuration (Debug, Release, etc.) where -mno-thumb appears.
  • A text input box will appear showing the list of flags.
  • Remove -mno-thumb from the list.
  1. Repeat for Other C++ Flags:
  • Perform the same steps for Other C++ Flags.
  1. Save and Rebuild:
  • Save the changes (it updates automatically in Xcode).
  • Clean the project (Product > Clean Build Folder or Cmd+Shift+K).
  • Rebuild the project.
4 Likes

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);
        }
    }
}
2 Likes

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.

1 Like

" Edit the Exported Xcode Project

  • Open the Xcode project generated by Unity.
  • In Xcode, navigate to Build Settings and search for OTHER_CFLAGS or OTHER_LDFLAGS.
  • Look for any occurrences of -mno-thumb and remove it."

This one worked. Thank you!