android-vision: Library delays or fails on download

On my app I use Google Mobile Vision in order to recognize faces. I use gms play library and it works fine on most devices :

'com.google.android.gms:play-services-vision:9.4.0+'

Here to note that I’ve tried also updated versions of gms vision like 15.0.0.

Recently I received many bad reviews and some users complained that app couldn’t recognize their face.

So I found some devices that had this issue and it seems that problem is Google Play Services delay a lot(or just fail) to download GMS vision even if device has much free storage.

Android Studio log says :

I/Vision: Loading library libmobile_vision_face.so
I/Vision: libmobile_vision_face.so library load status: false
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:1702
I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 1702

So it’s going like this : The first attempts for using my app failing since GMS Vision hasn’t been downloaded or working. But after some hours on most of the cases it seems that is working fine.

For understanding better why this happening I tried when app began to work well to clear Data of Google Play Services of device. It stopped working for a while and then after some hours its OK again without any user action.

So it seems that is a matter of Google Services.

Practically many devices would have problem using my app since they are very new enabled or user has recently wipe data etc or for any other random reason.

Can I do anything for that? Thank you for your awesome library and support.

About this issue

Most upvoted comments

Don’t know if this is related, but I have a very similar problem with bar code detection using play services. What I could find out: All affected phones went through an update from play services 12.6.73 to 12.6.85. We can mimic this with manual installs from APK-mirror. Until 12.6.73 everything is fine, after update to 12.6.85 the preview screen is black and the logs says: I/Vision: Loading library libbarhopper.so I/Vision: libbarhopper.so library load status: false The phone has been reset before this, so space for download is not a problem. I think this is a bug striking while updating to the new version. We mostly we’re not able to get barcode scans working again in this setting.

Things that sometimes seem to work:

  • Clear all data/cache from play services
  • switch from non-english language to english (duh) and back (our app is for the German market, so phones are usually set to German)

Things that reliably work:

  • factory reset the phone and have it install version 12.6.85 immediately (without a previous version)
  • uninstall all updates of play services and manually install 12.6.85

Fun part: This only affects Huawei phones.

I found solution i clear all data in app>google play service

And add this in AndroidMnifest.xml

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>

<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="face" />

Try this