Skip to content

fix: convert iOS frameworks to XCFrameworks for iOS 26+ simulator arm64 support#150

Open
maickonn wants to merge 1 commit into
sk3llo:masterfrom
maickonn:fix/ios-simulator-arm64
Open

fix: convert iOS frameworks to XCFrameworks for iOS 26+ simulator arm64 support#150
maickonn wants to merge 1 commit into
sk3llo:masterfrom
maickonn:fix/ios-simulator-arm64

Conversation

@maickonn
Copy link
Copy Markdown

@maickonn maickonn commented May 8, 2026

Summary

iOS 26+ simulators on Apple Silicon require arm64 architecture. The vendored ffmpeg frameworks (ffmpegkit.framework, libavcodec.framework, etc.) had their arm64 slice built for iOS device platform, not iOS Simulator. Xcode rejected linking them with:

Building for 'iOS-simulator', but linking in dylib built for 'iOS'

Changes

scripts/setup_ios.sh

After downloading and stripping bitcode, each .framework is converted to an .xcframework with two variants:

  • ios-arm64_arm64e — device variant, original arm64 + arm64e slices unchanged (platform IOS)
  • ios-arm64_x86_64-simulator — simulator variant, arm64 slice platform converted from IOS to IOSSIMULATOR via vtool -set-build-version, combined with the pre-existing x86_64 slice (already IOSSIMULATOR)

Headers and Modules directories are preserved in both variants.

ios/ffmpeg_kit_flutter_new.podspec

  • Updated vendored_frameworks to point to .xcframework files
  • Removed arm64 from EXCLUDED_ARCHS[sdk=iphonesimulator*] (only i386 remains) — no longer needed since XCFramework provides correct per-platform slices

Testing

  • iPhone 17 Pro simulator (iOS 26.4) — app builds, links, and runs successfully
  • iPhone 16 physical device (iOS 26.4.1) — app builds, links, and runs successfully

Backward Compatibility

  • Device builds: arm64 slice unchanged, linking works as before
  • Intel Mac simulators: x86_64 slice unchanged, linking works as before
  • Apple Silicon simulators (iOS 26+): arm64 slice now marked as IOSSIMULATOR, linking works

iOS 26+ simulators on Apple Silicon require arm64 architecture,
but the vendored ffmpeg frameworks (arm64 slice) were built for
iOS device platform, not iOS Simulator. Xcode rejected the link.

Fix: In setup_ios.sh, after downloading and stripping bitcode,
convert each .framework to .xcframework with two variants:
- ios-arm64_arm64e: device slices unchanged
- ios-arm64_x86_64-simulator: arm64 slice platform converted
  from IOS to IOSSIMULATOR via vtool, combined with x86_64 slice

Also remove arm64 from EXCLUDED_ARCHS in pod_target_xcconfig
since XCFramework provides correct per-platform slices.
@maickonn maickonn force-pushed the fix/ios-simulator-arm64 branch from 3468b0d to a2fc82e Compare May 8, 2026 02:09
@guang
Copy link
Copy Markdown

guang commented May 9, 2026

hit the same issue, @maickonn thanks for the PR!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants