Search code examples
androidocrfirebase-mlkit

Google ML Kit: Waiting for the text recognition model to be downloaded


[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.


Solution

  • 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.