0
votes

I am implementing text recognition into a react native app which uses firebase (ie: it uses the Firebase ML Kit / google vision API). I am using version 0.61.5 of react-native and version 6.3.* of react-native-firebase (ie: the latest versions at time of writing).

When performing text recognition on a physical phone:

  • Using cloudTextRecognizerProcessImage() works correctly
  • Using textRecognizerProcessImage() works correctly

When performing text recognition in the android studio emulator:

  • Using cloudTextRecognizerProcessImage() works correctly
  • Using textRecognizerProcessImage() fails with the following message
com.google.firebase.ml.common.FirebaseMLException: Waiting for the text recognition model to be downloaded. Please wait.

The model never gets downloaded after repeated attempts. As per the documentation here I have added implementation 'com.google.firebase:firebase-ml-vision:24.0.1' to app/build.gradle and added the following to AndroidManifest.xml:

  <meta-data
      android:name="com.google.firebase.ml.vision.DEPENDENCIES"
      android:value="ocr" />

Is there something else I need to do in order to get on device text recognition working in the emulator?

EDIT:

This happens with all types of on device image recognition including barcode scannning etc.

1

1 Answers

1
votes

Thanks for the feedback!

The issue with text recognition on emulators is that the google play service on emulator are usually outdated and are not supported by optional module download. On real devices, the google play service is auto updated once a new version is available.

The earliest version we support currently is 19.8.31. Could you try to update your emulator google play service version and test again?

Thanks! Chenxi