Android app cannot install ML kit's OCR model

5,574 views
Skip to first unread message

Big Monday

unread,
Oct 21, 2019, 11:00:23 AM10/21/19
to Firebase Google Group
Hello, I am building an application that involves ML kit. I am trying to use text recognition API. Then I ran my application from Android Studio I get th following logs when making a call to processImage() method:

W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite.ocr not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite.ocr:0 and remote module com.google.android.gms.vision.dynamite.ocr:0
D/TextNativeHandle: Cannot load feature, fall back to load dynamite module.
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.ocr not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.ocr:0 and remote module com.google.android.gms.vision.ocr:0
E/Vision: Error loading module com.google.android.gms.vision.ocr optional module true: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
W/System.err: com.google.firebase.ml.common.FirebaseMLException: Waiting for the text recognition model to be downloaded. Please wait.

This issue seems to only exist for text recognition, as ML kit works fine when I try to use barcode model:

I/DynamiteModule: Considering local module com.google.firebase.ml.vision.dynamite.barcode:10000 and remote module com.google.firebase.ml.vision.dynamite.barcode:0
    Selected local version of com.google.firebase.ml.vision.dynamite.barcode
I/tflite: Initialized TensorFlow Lite runtime.

I suspect that the issue here is that OCR model is being fetched from com.google.android.gms.vision.ocr.

Here are the dependencies I added in my build.gradle:

implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-ml-common:22.0.0'
implementation 'com.google.firebase:firebase-ml-vision:24.0.0'
implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.0.1'

Is there any way to fix this issue?

Sachin Kotwani

unread,
Oct 21, 2019, 12:39:38 PM10/21/19
to fireba...@googlegroups.com
Hi. Can you please share more details about the device you are using to test? Also, what version of Android is it running?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/5881f5f2-ec61-43ec-87c7-1ec99e1d5c93%40googlegroups.com.

Big Monday

unread,
Oct 27, 2019, 11:18:35 AM10/27/19
to Firebase Google Group
Sorry for the late response! I was able to solve the problem by explicitly updating Google Play Services on my emulator. 

My SO question with the answer is available here for anyone facing the same issue: https://stackoverflow.com/questions/58477758/android-studio-ml-kit-cannot-load-ocr-module/58579744#58579744


On Monday, October 21, 2019 at 12:39:38 PM UTC-4, Sachin Kotwani wrote:
Hi. Can you please share more details about the device you are using to test? Also, what version of Android is it running?

On Mon, Oct 21, 2019, 11:00 AM Big Monday <alice.mason...@gmail.com> wrote:
Hello, I am building an application that involves ML kit. I am trying to use text recognition API. Then I ran my application from Android Studio I get th following logs when making a call to processImage() method:

W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite.ocr not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite.ocr:0 and remote module com.google.android.gms.vision.dynamite.ocr:0
D/TextNativeHandle: Cannot load feature, fall back to load dynamite module.
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.ocr not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.ocr:0 and remote module com.google.android.gms.vision.ocr:0
E/Vision: Error loading module com.google.android.gms.vision.ocr optional module true: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
W/System.err: com.google.firebase.ml.common.FirebaseMLException: Waiting for the text recognition model to be downloaded. Please wait.

This issue seems to only exist for text recognition, as ML kit works fine when I try to use barcode model:

I/DynamiteModule: Considering local module com.google.firebase.ml.vision.dynamite.barcode:10000 and remote module com.google.firebase.ml.vision.dynamite.barcode:0
    Selected local version of com.google.firebase.ml.vision.dynamite.barcode
I/tflite: Initialized TensorFlow Lite runtime.

I suspect that the issue here is that OCR model is being fetched from com.google.android.gms.vision.ocr.

Here are the dependencies I added in my build.gradle:

implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-ml-common:22.0.0'
implementation 'com.google.firebase:firebase-ml-vision:24.0.0'
implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.0.1'

Is there any way to fix this issue?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages