juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
782 stars 464 forks source link

Compatibility Issue on Apple Silicon Mac - Simulator Build Fails with RxSwift or AdyenCard Modules #1121

Open bashcious opened 2 weeks ago

bashcious commented 2 weeks ago

I am encountering a compatibility issue when using the mobile_scanner package on an Apple Silicon Mac. The project builds and runs fine on a real device, but it fails on the simulator with the following error:

Swift Compiler Error (Xcode): Could not find module 'RxSwift' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator

Steps to Reproduce:

  1. Add the mobile_scanner package to the pubspec.yaml:

    dependencies:
    mobile_scanner: ^5.1.1
  2. Open xcode and add rxswift https://github.com/reactivex/rxswift

  3. Attempt to build and run the project on the iOS simulator.

Observed Behavior:

  1. The build fails with a Swift Compiler Error indicating that the RxSwift module is not found for the x86_64 architecture, but is found for arm64.
  2. Rxswift, AdyenCard and other dependencies are compatible and were working fine before adding mobile_scanner
  3. The issue does not occur when building for a real device
  4. The issue does not occur when building on simulator in Rosetta
  5. The issue does not occur when building on Intel Macbook

Removing the mobile_scanner package resolves the issue, but I need to use this package in my project.

Modules

image

Build Settings

image

I have tried playing with the Architecture no success.

Any insights or fixes would be greatly appreciated. Thank you for your assistance!

navaronbracke commented 2 weeks ago

We do have https://github.com/juliansteenbakker/mobile_scanner/issues/1018 as well, which indicates that we have issues with Apple Silicon Macs when compiling. However, I do not have access to an Apple Silicon Mac to debug this just yet.