expo: FaceDetector not working in iOS standalone builds after MLKit migration

šŸ› Bug Report

After FaceDetector started using MLKit, it stopped working in iOS standalone builds.

I think is related to Firebase not being configured correctly.

After running build:ios, generating production ipa and sending it to TestFlight this is the log when I open the screen with FaceDetector :

6.5.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.

Also I didn’t found anywhere I can provide my ā€œGoogleService-Info.plistā€ file to configure Firebase. I think this is obligatory now that FaceDetector uses MLKit.

I tried building a version for android without any GoogleService info, installed apk direct to device (without putting it in play store) and FaceDetector just works.

I’m missing something here?

Environment

  Expo CLI 3.0.9 environment info:
    System:
      OS: macOS 10.14.4
      Shell: 5.6.2 - /usr/local/bin/zsh
    Binaries:
      Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v12.6.0/bin/npm
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5199772
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^34.0.3 => 34.0.3
      react: 16.8.3 => 16.8.3
      react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8
      react-navigation: ^3.11.1 => 3.11.1
    npmGlobalPackages:
      expo-cli: 3.0.9
"dependencies": {
    "axios": "^0.19.0",
    "axios-retry": "^3.1.2",
    "expo": "^34.0.3",
    "expo-barcode-scanner": "~6.0.0",
    "expo-camera": "~6.0.0",
    "expo-face-detector": "~6.0.0",
    "expo-font": "~6.0.1",
    "expo-image-manipulator": "~6.0.0",
    "expo-linear-gradient": "~6.0.0",
    "expo-permissions": "~6.0.0",
    "lodash.debounce": "^4.0.8",
    "lodash.get": "^4.4.2",
    "lodash.inrange": "^3.3.6",
    "lodash.throttle": "^4.1.1",
    "native-base": "^2.12.1",
    "prop-types": "^15.7.2",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
    "react-native-confirmation-code-field": "^3.6.0",
    "react-native-gesture-handler": "~1.3.0",
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-orientation-loading-overlay": "^0.1.6",
    "react-native-pose": "^0.9.1",
    "react-native-reanimated": "~1.1.0",
    "react-native-size-matters": "^0.2.1",
    "react-native-snap-carousel": "^3.8.0",
    "react-native-web": "^0.11.4",
    "react-navigation": "^3.11.1",
    "react-redux": "^7.0.3",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "redux-saga": "^1.0.2",
    "reduxsauce": "^1.1.0"
  },

Targets: iOS and Android

Steps to Reproduce

build:ios app with FaceDetector.

Expected Behavior

FaceDetector working.

Actual Behavior

FaceDetector not working.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (9 by maintainers)

Most upvoted comments

add field ios.googleServicesFile to app.json (this requires latest cli)

Hi, in case anyone needs to find a solution for how to make the expo FaceDetector work in a standalone RN app (no expo & not ejected), here’s what I had to do:

  1. Generate my config file for Firebase
  2. Add this config file to the ios/ProjectName folder
  3. Initialize Firebase per instructions here, which basically means adding two lines to AppDelegate.m:
#import "AppDelegate.h"
// Add this line
@import Firebase;

And under the didFinishLaunchingWithOptions method:

// Use Firebase library to configure APIs
[FIRApp configure];