[英]Program type already present for ListenableFuture when adding Android WorkManager
When adding WorkManager
to my app, I'm getting the following build error.将
WorkManager
添加到我的应用程序时,我收到以下构建错误。
Program type already present: com.google.common.util.concurrent.ListenableFuture
程序类型已经存在:com.google.common.util.concurrent.ListenableFuture
I have used the pre-androidx version as mentioned on Pre-AndroidX Dependencies我使用了Pre-AndroidX Dependencies 中提到的 pre-androidx 版本
def work_version = "1.0.1"
implementation "android.arch.work:work-runtime:$work_version"
I tried checking the gradle my_app:dependencies
to get the dependency tree too.我尝试检查
gradle my_app:dependencies
以获取依赖树。 I couldn't find what library is causing the collision.我找不到导致冲突的库。
How to resolve this?如何解决这个问题?
I solved it by adding the guava library as a whole to the project.我通过将番石榴库作为一个整体添加到项目中来解决它。
def work_version = "1.0.1"
implementation "android.arch.work:work-runtime:$work_version"
implementation("com.google.guava:guava:29.0-jre")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.