Когда я пытаюсь построить свой проект, используя proguard, при предварительной проверке я получаю следующую ошибку:
Preverifying...
Unexpected error while performing partial evaluation:
Class = [com/google/android/gms/internal/zzmz]
Method = [zza(Lcom/google/android/gms/internal/zzmh;Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/google/android/gms/internal/zzne;Lcom/google/android/gms/internal/zzgf;Lcom/google/android/gms/internal/zzmy;)Lcom/google/android/gms/internal/zzmk;]
Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [com/google/android/gms/internal/zzmk] (with 1 known super classes) and [java/lang/String] (with 2 known super classes))
Unexpected error while preverifying:
Class = [com/google/android/gms/internal/zzmz]
Method = [zza(Lcom/google/android/gms/internal/zzmh;Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/google/android/gms/internal/zzne;Lcom/google/android/gms/internal/zzgf;Lcom/google/android/gms/internal/zzmy;)Lcom/google/android/gms/internal/zzmk;]
Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [com/google/android/gms/internal/zzmk] (with 1 known super classes) and [java/lang/String] (with 2 known super classes))
Warning: Exception while processing task java.io.IOException: java.lang.IllegalArgumentException: Can't find common super class of [com/google/android/gms/internal/zzmk] (with 1 known super classes) and [java/lang/String] (with 2 known super classes)
Я добавил следующее в proguard, есть и другие правила для других библиотек.
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
-keep class com.facebook.ads.** { *; }
-dontwarn com.google.android.gms.ads.**
В моем gradle.build есть следующие библиотеки
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:preference-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation "com.android.support:palette-v7:$rootProject.supportLibraryVersion"
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
implementation "android.arch.persistence.room:rxjava2:$rootProject.roomVersion"
//ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$rootProject.lifecycleVersion"
implementation "android.arch.work:work-runtime:$rootProject.workManagerVersion"
implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
implementation "com.jakewharton.timber:timber:$rootProject.timberVersion"
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.interceptorVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rx2AndroidVersion"
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rx2AndroidVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retrofitVersion"
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
implementation "com.android.billingclient:billing:$rootProject.billingVersion"
implementation "com.facebook.android:audience-network-sdk:$rootProject.facebookAds"
implementation ("com.google.android.gms:play-services-places:$rootProject.gPlacesVersion"){
exclude module: 'play-services-ads'
}
implementation ("com.google.android.gms:play-services-location:$rootProject.gLocationVersion") {
exclude module: 'play-services-ads'
}
implementation 'com.android.support:multidex:1.0.3'
implementation "com.google.firebase:firebase-core:$rootProject.firebaseCore"
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
// implementation "com.google.firebase:firebase-config:$rootProject.firebaseConfig"
implementation "com.google.firebase:firebase-perf:$rootProject.firebasePerf"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.lifecycleVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
Согласно сайту настройки сервисов Google Play, нет необходимости добавлять что-либо в proguard, когда я удаляю правила gms изproguard получить длинный список предупреждений, подобных этим
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced class com.google.android.gms.common.internal.zzf$zzb
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced class com.google.android.gms.common.internal.zzf$zzc
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced class com.google.android.gms.internal.zzaf
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced class com.google.android.gms.internal.zzaf$zza
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced class com.google.android.gms.internal.zzaf$zza
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced method 'void disconnect()' in program class com.google.android.gms.internal.zzapu
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced method 'boolean isConnected()' in program class com.google.android.gms.internal.zzapu
Warning: com.google.android.gms.internal.zzapt$zza: can't find referenced method 'boolean isConnecting()' in program class com.google.android.gms.internal.zzapu
Список предупреждений продолжается.Я могу добавить остальные правила Proguard, если требуется.Служба Google Play, которую я использую, - 4.1.0, и мои библиотеки Firebase обновлены, согласно сайту Firebase.использование версии 15.0.1 (новейшей) для Google play. Места и местоположения в Google Play
Proguard Output