Skip to content

iOS: Apple Silicon simulator requires Rosetta due to non-xcframework MLKit deps #259

@caevv

Description

@caevv

Summary

On Apple Silicon Macs, @infinitered/react-native-mlkit-face-detection transitively pulls in GoogleMLKit/FaceDetection versions that ship as classic fat .framework bundles (arm64 = device-only, no arm64-simulator slice). CocoaPods injects EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 into the host app's xcconfig to compensate, which forces the iOS simulator to build as x86_64 and run under Rosetta translation.

In that Rosetta-translated simulator, PHPickerViewController (the system image picker) is unreliable — the XPC plugin crashes on open, reproducibly:

[PlugInKit] [com.apple.mobileslideshow.photospicker(1.0)] Connection to plugin interrupted while in use.
[PlugInKit] [com.apple.mobileslideshow.photospicker(1.0)] Connection to plugin invalidated while in use.
[PhotosUI] Showing picker unavailable UI (reason: crashed) with error: (null)

The picker UI renders thumbnails then becomes fully unresponsive to touch. Running on a physical device works fine.

Repro / Evidence

  • @infinitered/react-native-mlkit-face-detection@5.0.0
  • @infinitered/react-native-mlkit-core@5.0.0
  • CocoaPods resolves transitively to:
    • GoogleMLKit/FaceDetection (~> 7.0.0)
    • MLKitFaceDetection (~> 5.0.0)
    • MLKitCommon (~> 11.0.0)
    • MLKitVision (~> 7.0)
  • Pods-*.debug.xcconfig contains EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64

Removing the exclusion to try arm64 simulator produces the expected linker error:

ld: building for 'iOS-simulator', but linking in object file
(Pods/MLImage/Frameworks/MLImage.framework/MLImage[arm64][2](GMLImage.o))
built for 'iOS'

...confirming the arm64 slice in the fat framework is device-only, not simulator.

Environment

  • Expo SDK 55, React Native 0.83.4, Hermes, Fabric enabled
  • macOS arm64 (Apple Silicon, native — not under Rosetta)
  • Xcode 16, iOS 18.6 simulator

Request

Google now publishes MLKit pods as proper .xcframework bundles with dedicated ios-arm64-simulator slices in newer releases. Could the podspecs in this repo (RNMLKitFaceDetection.podspec, RNMLKitCore.podspec) be updated to depend on GoogleMLKit versions that ship xcframeworks? That would remove the need for EXCLUDED_ARCHS = arm64 and let consumers build the simulator natively on Apple Silicon, avoiding the Rosetta + PHPicker failure mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions