Android studio minifyEnabled为true时生成apk时出错

Android studio minifyEnabled为true时生成apk时出错,android-studio,proguard,Android Studio,Proguard,我对proguard有意见。 错误是: 找不到[com/google/android/gms/location/LocationResult](具有1个已知的超类)和[com/google/android/gms/location/LocationAvailability](具有1个已知的超类)的通用超类 proguard-rules.pro的代码: -keep class com.name.ee.model.** { *; } -keep class com.name.ee.response.

我对proguard有意见。 错误是: 找不到[com/google/android/gms/location/LocationResult](具有1个已知的超类)和[com/google/android/gms/location/LocationAvailability](具有1个已知的超类)的通用超类

proguard-rules.pro的代码:

-keep class com.name.ee.model.** { *; }
-keep class com.name.ee.response.** { *; }

#--------- Glide

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {

  **[] $VALUES;
  public *;}

#--------- OkHttp
-dontwarn okio.**
-dontwarn okhttp3.**

#--------- Calligraphy
-keep class uk.co.chrisjenx.calligraphy.* { *; }
-keep class uk.co.chrisjenx.calligraphy.*$* { *; }

#--------- DBflow
-keep class * extends com.raizlabs.android.dbflow.config.DatabaseHolder { *; }
-keep class com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder
-keep class * extends com.raizlabs.android.dbflow.config.BaseDatabaseDefinition { *; }

#--------- Retrofit

-dontnote retrofit2.Platform
-dontwarn retrofit2.Platform$Java8
-keepattributes Signature
-keepattributes Exceptions

#--------- GSON
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

#-dontwarn android.support.v4.**
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**


-ignorewarnings

-keep class * {public private *;}
具体实施包括:

//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation "com.google.android.gms:play-services-gcm:16.0.0"

我认为你的问题必须用适当的方法解决 将android studio更新为3.3.1