aarongrider / vision-camera-ocr

VisionCamera Frame Processor Plugin to detect text in real time using MLKit Text Detector (OCR)
MIT License
235 stars 86 forks source link

Cannot build on M1 - iOS Simulator #2

Open qkqk opened 2 years ago

qkqk commented 2 years ago

I can't build for iOS Simulator on Apple M1 chip, building for real iPhone device works without a problem.

When trying to build for simulator it will give this error:

Screenshot 2022-03-22 at 21 35 43

I think that it's something with libraries used with vision-camera-ocr setting - EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 on xcode project.

I have tried to remove arm64 exclusion but then I get this error:

building for iOS Simulator, but linking in object file built for iOS

houabdu commented 1 year ago

same issue here

houabdu commented 1 year ago

According to this: https://issuetracker.google.com/issues/178965151, Google still doesn't fully support MLKIT on Apple Silicon. I think this repo can't do anything.

But this works for me:

  1. Open Terminal with Rosetta (https://medium.com/codex/simple-way-to-use-cocoapods-on-m1-ac9e22cf7e1c)
  2. sudo gem install ffi (dont know if its necessary)
  3. Remove all installed pods rm -rf ios/pods
  4. Reinstall pod install
  5. Moist important: Build with rosetta