rodgomesc / vision-camera-code-scanner

VisionCamera Frame Processor Plugin to read barcodes using MLKit Vision QrCode Scanning
MIT License
336 stars 221 forks source link

Failed to build in Apple M1 #157

Open zhiying038 opened 1 year ago

zhiying038 commented 1 year ago

Issue: Failed to build project when running in Apple M1.

Any assistance would be appreciated.

Versions: OS Version: iOS iOS Version: 16.2 react-native: 0.71.7 react-native-vision-camera: 2.15.4 vision-camera-code-scanner: 0.2.0 react-native-reanimated: 2.10.0

Screenshot 2023-08-17 at 3 38 02 PM
DeveloperMCD commented 1 year ago

I'm having almost the exact same error, but with slightly different package versions:

React-Native 0.72.4 Latest iOS React-Native-Vision-Camera 3.0.0-rc4 React-native-Reanimated: (latest) I believe 3.4.0

whisperzh commented 1 year ago

You can try run xcode in rosetta.

eisodev commented 1 year ago

You can try run xcode in rosetta.

One plugin should not force us to run xcode in rosetta. They should add note on top of README that this plugin doesn't support arm yet, would have saved us alot of time. I work on intel but collegues on arm. So this is a big problem.

DavideSegullo commented 1 year ago

I had the same problem, but I solved it by adding this line in the pod file of my RN project (after xcode fix):

__apply_Xcode_12_5_M1_post_install_workaround(installer)
....
# arm64 simulator EXCLUDED_ARCHS setting:
installer.pods_project.build_configurations.each do |config|
  config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end