I am trying to use Google's MLKit in Android Studio, but no matter which MLKit Vision app I'm trying to start, I keep getting the following error in my Logcat:
Error preloading model resource com.google.mlkit.common.MlKitException: Waiting for the text optional module to be downloaded. Please wait.
And further:
at com.google.mlkit.vision.text.internal.zzb.zzb(com.google.android.gms:play-services-mlkit-text-recognition-common@@18.0.0:22) at com.google.mlkit.vision.text.internal.TextRecognizerTaskWithResource.load(com.google.android.gms:play-services-mlkit-text-recognition-common@@18.0.0:1) at com.google.mlkit.common.sdkinternal.ModelResource.zza(com.google.mlkit:common@@18.5.0:4) at com.google.mlkit.common.sdkinternal.zzn.run(Unknown Source:10) at com.google.mlkit.common.sdkinternal.zzt.run(com.google.mlkit:common@@18.5.0:2) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(com.google.mlkit:common@@18.5.0:4) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(com.google.mlkit:common@@18.5.0:1) at com.google.mlkit.common.sdkinternal.zzk.run(Unknown Source:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(com.google.mlkit:common@@18.5.0:2) at com.google.mlkit.common.sdkinternal.zzi.run(Unknown Source:2) at java.lang.Thread.run(Thread.java:1012)
Depending on the app, the app itself still loads, but the OCR module (or TextRecognizer) wouldn't work.
System specs:
So, my system is up to date. So are the plugins I'm using in Android Studio.
I was very surprised to see that apparently nobody ever had this or similar issues in Android Studio. Still, help is very much appreciated.
Are you using a simulator to run? By default simulator wont have a gmscore so it cannot download optional module for you. You can either: