Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Simulator build fails because a library was built for real iPhones

Errorbuilding for 'iOS-simulator', but linking in object file (…) built for 'iOS'

Short answer

The linker was building for the Simulator and met a library compiled only for physical iPhones. On an Apple silicon Mac both are arm64, so the architecture matches but the platform does not. Ask the named file which platform it was built for, then update that pod or framework to an XCFramework, remove old EXCLUDED_ARCHS overrides, reinstall pods, and keep Xcode out of Rosetta.

  • Applies to Xcode 26, Flutter 3.50 stable, CocoaPods 1.17, macOS 26 on Apple silicon
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Copy the path of the library from the error and ask it which platform each slice was built for. A slice that says IOS where the build wanted IOSSIMULATOR means the binary itself is wrong; if every slice says IOSSIMULATOR, the build settings are the problem.

    xcrun vtool -show-build path/to/Vendor.framework/Vendor | grep -E 'architecture|platform'
  2. 2Match what you see, then jump to its fix

    1. 1The path in the error ends in a .framework or .a inside ios/Pods, and vtool shows 'platform IOS' for arm64A pod or plugin ships a binary with no arm64 Simulator sliceFix
    2. 2The project builds on an Intel Mac and fails on Apple silicon, or the log also mentions x86_64 or 'Undefined symbols for architecture x86_64'Old architecture overrides force the wrong Simulator sliceFix
    3. 3The error started right after a Flutter, Xcode or plugin upgrade and names a file under ios/Pods or DerivedDataPods and build products are stale after an upgradeFix
    4. 4Every target builds for x86_64, or sysctl.proc_translated prints 1Xcode or the terminal runs under RosettaFix

What does the error look like?

  • building for 'iOS-simulator', but linking in object file (…) built for 'iOS'
  • building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
  • is missing architecture(s) required by this target (arm64), but may still be link-compatible
  • clang: error: linker command failed with exit code 1 (use -v to see invocation)

Cause 1 of 4

A pod or plugin ships a binary with no arm64 Simulator slice

1Check

Older vendor SDKs were packed as one fat binary: arm64 for devices plus x86_64 for Intel Simulators. On Apple silicon the Simulator also needs arm64, and a single binary cannot hold two arm64 slices for different platforms, so the device slice gets linked and rejected. lipo shows the architectures and vtool the platform of each.

lipo -info ios/Pods/VendorSDK/VendorSDK.framework/VendorSDK
xcrun vtool -show-build ios/Pods/VendorSDK/VendorSDK.framework/VendorSDK | grep -E 'architecture|platform'

2Fix

Update the Flutter plugin or pod that brings the binary in; most vendors now ship an XCFramework with separate device and Simulator folders. If the library is yours, archive it once for each platform and join the archives into an XCFramework. Only while you wait for a vendor fix, Apple allows excluding arm64 for the Simulator SDK alone and running on a Rosetta Simulator destination, then removing that setting once the update lands.

flutter pub outdated
flutter pub upgrade some_plugin

# your own framework: one archive per platform, then one XCFramework
xcodebuild archive -scheme VendorSDK -destination "generic/platform=iOS" -archivePath build/VendorSDK-iOS SKIP_INSTALL=NO
xcodebuild archive -scheme VendorSDK -destination "generic/platform=iOS Simulator" -archivePath build/VendorSDK-Sim SKIP_INSTALL=NO
xcodebuild -create-xcframework \
  -archive build/VendorSDK-iOS.xcarchive -framework VendorSDK.framework \
  -archive build/VendorSDK-Sim.xcarchive -framework VendorSDK.framework \
  -output build/VendorSDK.xcframework

3Verify

The new copy has a Simulator folder whose binary reports IOSSIMULATOR, and the Simulator build links.

ls build/VendorSDK.xcframework
flutter build ios --simulator
Did this fix it?

Cause 2 of 4

Old architecture overrides force the wrong Simulator slice

1Check

A common workaround from the first Apple silicon years put EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 (or a VALID_ARCHS list) into the Podfile or the Runner target. Mixed with pods that now build arm64 Simulator code, the app and its libraries no longer agree on one slice. Look for those settings in both places and in what Xcode actually resolves.

grep -n "EXCLUDED_ARCHS\|VALID_ARCHS" ios/Podfile ios/Runner.xcodeproj/project.pbxproj
xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner -sdk iphonesimulator \
  -showBuildSettings | grep -E "^ *(ARCHS|EXCLUDED_ARCHS|ONLY_ACTIVE_ARCH) ="

2Fix

Delete the overrides so every target falls back to Xcode's defaults; remove VALID_ARCHS entirely rather than leaving it empty. In a Flutter app the Podfile's post_install block only needs Flutter's own helper, which already sets the Simulator flags the engine expects.

# ios/Podfile
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

3Verify

Reinstall pods and confirm arm64 no longer appears in the resolved EXCLUDED_ARCHS for the Simulator.

cd ios && pod install && cd ..
flutter build ios --simulator
Did this fix it?

Cause 3 of 4

Pods and build products are stale after an upgrade

1Check

Podfile.lock pins the pod versions you installed months ago, and DerivedData can keep linking an object compiled before the fix. Compare what is installed with what is available.

cd ios && pod outdated

2Fix

Clear Flutter's and Xcode's build output, let the pods resolve again, and reinstall. If your Flutter version uses Swift Package Manager for plugins, plugins that support it no longer go through CocoaPods at all; the CocoaPods registry becomes read-only on 2 December 2026, so a vendor fix may only arrive as a Swift package.

flutter clean
rm -rf ios/Pods ios/Podfile.lock ~/Library/Developer/Xcode/DerivedData/Runner-*
flutter pub get
cd ios && pod install --repo-update

3Verify

Podfile.lock now lists the newer pod versions and the Simulator build links.

git diff --stat ios/Podfile.lock
flutter build ios --simulator
Did this fix it?

Cause 4 of 4

Xcode or the terminal runs under Rosetta

1Check

Opening your terminal (or an older Xcode) with 'Open using Rosetta', or installing CocoaPods with an Intel Homebrew under /usr/local, makes the tools think the Mac is Intel. The build then picks x86_64 Simulator slices and clashes with libraries that only ship arm64 for the Simulator. Apple's own note says not to launch Xcode under Rosetta to get around these link errors.

sysctl -n sysctl.proc_translated   # 1 = translated, 0 = native
uname -m
which pod

2Fix

Turn off 'Open using Rosetta' in Finder > Get Info for your terminal app (and for Xcode, if the box is shown), open a new window, and reinstall CocoaPods with the arm64 Homebrew in /opt/homebrew. Do not lean on Rosetta Simulator destinations as a fix: Apple says macOS 27 is the last release with general Rosetta support.

brew install cocoapods     # /opt/homebrew/bin/brew on Apple silicon
which pod                  # expect /opt/homebrew/bin/pod

3Verify

The terminal reports a native arm64 shell and the Simulator build succeeds.

sysctl -n sysctl.proc_translated
flutter build ios --simulator
Did this fix it?

How do I stop it coming back?

  • Before adding a binary SDK, check that it ships as an XCFramework with an ios-arm64_x86_64-simulator (or ios-arm64-simulator) folder.
  • Keep architecture settings at Xcode's defaults; if you must exclude something for a vendor, write a comment with the date and the version that will remove it.
  • Run a Simulator build in CI on an Apple silicon runner, so a device-only binary fails there and not on a teammate's laptop.
  • Move plugins to Swift Package Manager where they support it, and remove CocoaPods once every dependency does.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.