android - 在模块 guava-20.0.jar (com.google.guava:guava:20.0) 中发现重复的类 com.google.common.util.concurrent.ListenableFuture
问题描述
当我implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0'
在 my中使用时app/build.gradle
,我收到此错误:
Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)
Go to the documentation to learn how to Fix dependency resolution errors.
我也有app/build.gradle
这样的:
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-iid:17.1.2'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'android.arch.work:work-runtime:1.0.1'
implementation 'com.android.support:multidex:1.0.3'
apply plugin: 'com.google.gms.google-services'
也许我正在使用的库之一已经包含对 In-App Messaging 依赖项的支持,然后它就变得多余了?谢谢你。
解决方案
2020解决方案
谷歌知道这个错误,所以他们制作了一个特殊的包来解决冲突。
将此添加到您的build.gradle
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
推荐阅读
- centos - NS_ERROR_FILE_ACCESS_DENIED 关于使用 filtaquilla add for Thunderbird 下载附件
- angular - 将 Angular[2] V3、Dart 1 的路由转换为 Angular 5、Dart 2
- python - 当参数为零时,带参数的 SymPy dsolve 给出错误答案
- hybris - 在产品列表页面顶部显示一些正在创建的新产品
- c# - 在 TabControl 中调整 TabPage 的大小
- angular - Angular 6,SonarQube:检查 package.json 时不忽略 src 文件夹
- node.js - 如何通过 Firebase 功能连接到本地服务器
- gulp - Gulp 总是抛出错误找不到模块'gulp-util'
- bash - 如何遍历列表,忽略列表中的某些元素?
- javascript - 如何在jquery中处理同时发生的点击事件