iosxcodecocoapodsxcode-build-settings

Xcode 15 Simulator Compile with x86_64


After updating to Xcode 15, I'm no long able to run my code on a simulator. Currently I'm getting the error

building for 'iOS-simulator', but linking in object file (/{project path}/libs/IceLink/libFMIceLinkOpus.a[x86_64][15](bands.o)) built for 'iOS'

When upgrading my Mac to the silicone chip, I did have similar issues where I had to insert this into my Podfile

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            # Needed for building for simulator on M1 Macs
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
    end
end

Online there were similar errors with arm64 architecture, which included updating the Excluded Architectures in the Build Settings. I figured I would do the same with x86_64

enter image description here

And after doing so I received another error when trying to run the code on a simulator

Command PhaseScriptExecution failed with a nonzero exit code

Is this the correct path to go down, or should I look at another path? I'm not sure if adding x86_64 to the Excluded Architectures is just leading me down a rabbit hole when I should be taking another route.


Solution

  • It seems it is caused by Xcode 15's new linker,add the -ld64 flag under Other Linker Flags i solve this issue.