找不到[com / google / android / gms / internal / zzol]

时间:2018-10-11 05:06:54

标签: android android-studio google-play-services android-proguard

我想构建APK文件,但是使用Proguard时出现此错误:

  

找不到[com / google / android / gms / internal / zzol](具有2个已知的超级类)和[com / google / android / gms / internal / zzoj](具有2个已知的超级类)的公共超类课

这是我的礼物:

dependencies {
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation ('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
        exclude module: 'support-v4'
    }

    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.github.shell-software:fab:1.1.2'
    implementation 'com.alirezaafkar:sundatepicker:2.0.8'
    implementation 'me.dm7.barcodescanner:zxing:1.9'

    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.alirezaafkar:sundatepicker:2.0.8'
    implementation 'me.cheshmak:analytics:2.0.+'
}

这是我试图解决该错误的防护措施,但是它不起作用:

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

我该如何解决?

1 个答案:

答案 0 :(得分:0)

这可能是由于Play服务库版本冲突造成的。确保在所有情况下都使用相同版本,例如16.0.0。

由于您已经对所有它们使用16.0.0,因此它可能是您自己的其他依赖项之一,其中包括自己的旧版Play服务库。因此,您必须找到该依赖项的更新版本,或者可以尝试排除依赖项所包含的Play服务库:

implementation ('com.some.library:module:1.2.3') {
    exclude group: 'com.google.android.gms', module: 'play-services-...'
}

其中play-services-...是另一个依赖项包含的冲突库。