Reputation: 14661
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:
cloudTextRecognizerProcessImage()
works correctlytextRecognizerProcessImage()
works correctlyWhen performing text recognition in the android studio emulator:
cloudTextRecognizerProcessImage()
works correctlytextRecognizerProcessImage()
fails with the following messagecom.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.
Upvotes: 1
Views: 771
Reputation: 3087
For on-device text recognition on both platforms using ML Kit and react native you can try https://github.com/a7medev/react-native-ml-kit/tree/main/text-recognition
Upvotes: 0
Reputation: 605
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
Upvotes: 1