a7medev / react-native-ml-kit

React Native On-Device Machine Learning w/ Google ML Kit
MIT License
342 stars 55 forks source link

Compile error after installing face-detection with expo #48

Closed scottmsul closed 4 months ago

scottmsul commented 4 months ago

What happened?

I'm attempting to use face detection in my app, however installing this library seems to cause issues. I've gotten it to work on android but ios leads to a compiler error. I've isolated this issue by trying to install it in a fresh new project:

$ npx create-expo-app TestApp
$ cd TestApp
$ npx expo install @react-native-ml-kit/face-detection
$ npx expo prebuild
$ npx expo run:ios

After compiling files for a while it leads to this:

❌  (ios/Pods/Target Support Files/Pods-TestApp/ExpoModulesProvider.swift:8:8)

   6 |  */
   7 | 
>  8 | import ExpoModulesCore
     |        ^ could not find module 'ExpoModulesCore' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/scottsullivan/Library/Developer/Xcode/DerivedData/TestApp-ftxbezwvqfynnbeowrmsfgupxemc/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule
   9 | import EXConstants
  10 | import ExpoFileSystem
  11 | import ExpoKeepAwake

› 1 error(s), and 0 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.

This was with npm 10.2.4, expo 50.0.7, react native 0.73.4, and react-native-ml-kit/face-detection 1.3.1, using xcode 15.2.

Version

@react-native-ml-kit/barcode-scanning: version@react-native-ml-kit/face-detection: version@react-native-ml-kit/identify-languages: version@react-native-ml-kit/image-labeling: version@react-native-ml-kit/text-recognition: version@react-native-ml-kit/translate-text: version

Which ML Kit packages do you use?

What platforms are you seeing this issue on?

System Information

info Fetching system and libraries information... System: OS: macOS 14.3.1 CPU: (8) arm64 Apple M2 Memory: 248.75 MB / 16.00 GB Shell: version: 3.2.57 path: /bin/bash Binaries: Node: version: 20.11.1 path: /usr/local/bin/node Yarn: version: 1.22.21 path: /usr/local/bin/yarn npm: version: 10.2.4 path: /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: version: 1.15.2 path: /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms:

Steps to Reproduce

$ npx create-expo-app TestApp
$ cd TestApp
$ npx expo install @react-native-ml-kit/face-detection
$ npx expo prebuild
$ npx expo run:ios
scottmsul commented 4 months ago

Apologies, this looks like google's fault. I'm still pretty new to react native and didn't realize ml kit wasn't supported on apple silicon simulator, and there's been an open issue with google for several years now.

https://issuetracker.google.com/issues/178965151