Program type already present: com.google.common.util.concurrent.ListenableFuture

在项目中使用到guava和WorkManager这两个库出现了如标题的错误,出现了冲突

“`
Program type already present: com.google.common.util.concurrent.ListenableFuture
“`

通过搜索资料发现可以在引入库的时候将WorkManager库引用的时候对guava的listenablefuture这个moudule进行排除就能解决这个问题,具体写法如下

“`
implementation(“android.arch.work:work-runtime-ktx:work_version”) {
exclude group: ‘com.google.guava’, module: ‘listenablefuture’
}

// optional – Firebase JobDispatcher support
implementation(“android.arch.work:work-firebase:work_version”){
exclude group: ‘com.google.guava’, module: ‘listenablefuture’
}

“`

0 0 vote
Article Rating
Subscribe
提醒
guest
0 评论
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x