简体   繁体   English

添加 Android WorkManager 时已存在用于 ListenableFuture 的程序类型

[英]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.

相关问题 添加新库时出现错误“程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior” - Error “Program type already present: android.support.design.widget.CoordinatorLayout$Behavior” when adding new libraries Android程序类型已存在 - Android program type already present 如何解决已存在的程序类型:com.google.common.util.concurrent.ListenableFuture? - How to solve Program type already present: com.google.common.util.concurrent.ListenableFuture? 已存在的计划类型:com.google.common.util.concurrent.ListenableFuture - Program type already present: com.google.common.util.concurrent.ListenableFuture 错误程序类型已存在:com.google.common.util.concurrent.ListenableFuture - Error Program type already present: com.google.common.util.concurrent.ListenableFuture Flutter build with CI 获取错误程序类型已经存在:com.google.common.util.concurrent.ListenableFuture - Flutter build with CI getting error Program type already present: com.google.common.util.concurrent.ListenableFuture 错误程序类型已经存在:程序类型已经存在:添加新库时的androidx.recyclerview.widget.AdapterHelper$Callback - Error Program type already present: Program type already present: androidx.recyclerview.widget.AdapterHelper$Callback when adding new libraries 程序类型已经存在:com.google.android.gms.internal.measurement.zzu在添加firebase-perf库时 - Program type already present: com.google.android.gms.internal.measurement.zzu when adding firebase-perf library Android Studio - 错误:程序类型已存在 - Android Studio - Error:Program type already present Android-编译错误:程序类型已存在 - Android - Compilation error: program type already present
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM