问题
[mlkit]
I am implementing the "On-device text recognition" from the Google Machine Learning Kit for android. I followed this guide but every time try to detect text I get the exception "Waiting for the text recognition model to be downloaded. Please wait."
Obviously, waiting doesn't help, neither does making a new detection 10 seconds later.
I have the meta tag
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="text" />
in my manifest's app tag, which is supposed to pre-download the recognition model upon app installation.
Edit: I just tried the sample app(text-recognition/final) and it has the exact same issue.
Am I missing something or is there a bug with the API? Any help would be appreciated.
回答1:
Agree with the answer above that this can happen if the storage on the device is not sufficient or say the internet is not available at all (which seems unlikely given the question). This is a one-time issue faced during development (unless the app cache is cleared).
Just want to add an answer on the manifest meta-tag part. The tag in the manifest avoids this problem in production by pre-downloading the recognition model upon app installation from Play Store:
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="ocr" />
回答2:
After further investigation, we found that the problem occurs only on a specific device and it coincided with other ad mob anomalies. I tried the following and it works:
Settings->Apps->Google Play Services->Storage->Manage Space->Clear All Data
The first request after that still returned the same error as before, but the second request succeeded.
来源:https://stackoverflow.com/questions/50331999/google-ml-kit-waiting-for-the-text-recognition-model-to-be-downloaded