Problems Obfuscating Proguard After Adding New Google Android Login Application

The new Google Play Services library (8.3.0) has a new way to sign in. This method involves adding the following dependencies:

build.gradle (application level): classpath 'com.google.gms:google-services:1.4.0-beta3'

And at the application level:

 compile 'com.google.android.gms:play-services-auth:8.3.0' `apply plugin: 'com.google.gms.google-services'` 

When you create a release application version with minifyEnabled set to false , the application is freed and works fine. However, when creating a release version with minifyEnabled set to true when the application minifyEnabled at startup with the following exception:

 java.lang.RuntimeException: Unable to get provider com.google.android.gms.measurement.AppMeasurementContentProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementContentProvider" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-1/lib/arm, /vendor/lib, /system/lib]] 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5156) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 11-08 12:47:13.497 3672-3672/? E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementContentProvider" on path: DexPathList[[zip file "/data/app/xxx.xxx... 

I tried to add these settings to the proguard project configuration, but this does not help (the same exception persists):

 -optimizationpasses 5 -keepattributes SourceFile,LineNumberTable,Exceptions, Signature, InnerClasses,*Annotation* -keep class com.google.android.gms.** { *; } -dontwarn com.google.android.gms.** 
+7
java android android-gradle google-play-services android-proguard
source share
1 answer

I have already logged an error report for this .

0
source share

All Articles