android - 找不到 [com/google/android/gms/internal/zzol] 的通用超类
问题描述
我想构建 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.+'
}
这是我试图解决错误的proguard,但它不起作用:
-keep public class com.google.android.gms.* { public *; }
-keep class com.google.android.gms.* { *; }
-keep class com.google.* { *; }
-dontwarn com.google.**
我怎样才能解决这个问题?
解决方案
这可能是由 Play Service 库的版本冲突引起的。确保您在任何地方都使用相同的版本,在您的情况下为 16.0.0。
由于您已经对所有这些都使用了 16.0.0,因此它可能是您的其他依赖项之一,其中包括一个旧版本的 Play Service 库。因此,您必须找到该依赖项的更新版本,或者您可以尝试排除该依赖项包含的 Play Service 库:
implementation ('com.some.library:module:1.2.3') {
exclude group: 'com.google.android.gms', module: 'play-services-...'
}
play-services-...
另一个依赖项包含的冲突库在哪里。
推荐阅读
- java - 如何在 JAVA 中使用 Stream 来获取具有匹配值的对象?
- excel - 如何从垂直数据中水平查找数据?
- android - 我的充满输入 svInfo.flags 的 Logcat 是 8
- java - Flink Java API - Pojo 类型到元组数据类型
- selenium - 下一个缩略图的 Xpath 优化解决方案?(对于硒自动化解决方案)
- c# - Masstransit 配置通用消费者
- django - 如何知道在 Django 中创建特定项目的用户?
- java - 我正在向 JLabel 添加一种有点奇怪的字体,但它没有按应有的方式显示
- bash - 如何操作从 Bash 脚本中的路由表中获取的特定 IP 地址
- c - 如何修复错误“指针和整数之间的比较”?