我想构建 APK 文件,但在使用 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)
这是我的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.+'
}
这是我试图解决错误的混淆器,但它不起作用:
-keep public class com.google.android.gms.* { public *; }
-keep class com.google.android.gms.* { *; }
-keep class com.google.* { *; }
-dontwarn com.google.**
我该如何解决这个问题?
最佳答案
这可能是由 Play 服务库的版本冲突引起的。确保你在任何地方都使用相同的版本,在你的例子中是 16.0.0。
由于您已经为所有这些使用了 16.0.0,它可能是您的其他依赖项之一,它本身包含旧版本的 Play 服务库。所以你必须找到那个依赖的更新版本,或者你可以尝试排除依赖包含的 Play Service 库:
implementation ('com.some.library:module:1.2.3') {
exclude group: 'com.google.android.gms', module: 'play-services-...'
}
其中 play-services-...
是另一个依赖项包含的冲突库。
关于android - 找不到 [com/google/android/gms/internal/zzol] 的通用父类(super class),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52752583/