简体   繁体   中英

Can't find common super class of [com/google/android/gms/internal/zzol]

I want to build the APK file, but I get this error when using Proguard:

Can't find common super class of [com/google/android/gms/internal/zzol] (with 2 known super classes) and [com/google/android/gms/internal/zzoj] (with 2 known super classes)

This is my gradle:

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.+'
}

This is my proguard for trying to resolve the error, but it's not working:

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

How can I fix this?

This might be caused by conflicting versions of Play Service libraries. Make sure you are using the same version everywhere, in your case 16.0.0.

Since you already use 16.0.0 for all of them, it's probably one of your other dependencies that includes an older version of a Play Service library on its own. So you have to find an updated version of that dependency, or you can try to exclude the Play Service library included by the dependency:

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

where play-services-... is the conflicting library included by the other dependency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM