0

I'm using the following in my gradle file

implementation 'com.google.android.gms:play-services-location:11.6.0'

And based on the following article, in my proguard file I have: http://www.androiddocs.com/google/play-services/setup.html

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

However, I think this was designed for an older version 6.5 rather than 11.6. I also read, that later versions (12 and 15?) add the proguard settings themselves, yet I cannot get any of them to build successfully into an APK.

I recently updated to android studio 3.1.2. And cannot trace what the actual class is that is causing the issue, as I have no idea where the "logs" it refers to are. Or if I've seen them and they don't contain the info.

It's definitely this library. As omitting it I can build fine.

enter image description here

I've also added the following but no luck:

-keep class com.google.android.gms.location.** { *; }
-keep class com.google.android.gms.internal.** { *; }
-keep class com.google.android.gms.** { *; }
-keep class com.google.android.** { *; }
-keep class com.google.** { *; }
-keep class com.google.android.gms.tasks.** { *; }
-keep class com.google.android.gms.common.** { *; }
-keep class com.google.android.gms.common.api.** { *; }
-dontwarn com.google.android
pgSystemTester
  • 8,979
  • 2
  • 23
  • 49
Mcloving
  • 1,390
  • 1
  • 13
  • 30
  • There is probably another problem. I have successfully build play service with proguard turned on. – ישו אוהב אותך May 24 '18 at 08:45
  • @ישואוהבאותך I just tried with https://stackoverflow.com/a/19388101/940834 . `-dontwarn com.google.android.gms.**` and it works now, but i dont understand why it is needed if they are kept. I thought dontwarn was for if they are not kept, but can be ignored. I dont understand it. – Mcloving May 24 '18 at 08:57
  • 1
    We embed proguard directives into the Google Play services SDK AAR files so you shouldn't ever need to specify your own for recent versions. Do you have a small repro (preferrably using 15+ versions) or could you fork an official sample on GitHub and link here? Additionally, your dep tree (./gradlew :app:dependencies) posted here might short-circuit an answer as well. – PaulR May 24 '18 at 19:33

0 Answers0