简体   繁体   中英

GOOGLE PLAY SERVICES EXCEPTION: com.google.android.gms.common.GooglePlayServicesUtil

I am trying to integrate Google Play Games into my app. It is currently working in debug mode. However, it does not seem to work in release mode. I am getting errors. I tried clean and rebuild.

java.lang.RuntimeException: Unable to get provider com.google.android.gms.measurement.AppMeasurementContentProvider: java.lang.ClassNotFoundException

And then this one:

GOOGLE PLAY SERVICES EXCEPTION: com.google.android.gms.common.GooglePlayServicesUtil

Followed by this one:

There is a problem with the Google Play Services library, which is required for Android Advertising ID support. The Google Play Services library should be integrated in any app shipping in the Play Store that uses analytics or advertising.

What could be wrong? I tried experimenting with Gradle, but no luck yet.

If I disable Proguard, it works! This seems to be a known issue, but not resolved yet. Any ideas?

The problem was that in my Gradle I was using

classpath 'com.google.gms:google-services:1.5.0-beta2'

Now I am using

classpath 'com.google.gms:google-services:1.5.0'

add below code in your proguard-rule.pro and try to regenerate APK

-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.**{ *; }
-keep interface com.google.android.gms.** { *; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM