ERROR: Unable to resolve dependency for ':module-login@dev_repDebugAndroidTest/compileClasspath': Could not resolve androidx.work:work-runtime-ktx:[2.1.0].
Disable offline mode and sync project
Show Details
Affected Modules: module-login
一般是引用的包沖突了
搜索得知,我直接引用了:::androidx.work:work-runtime-ktx:2.3.4,但有些包間接引用了 androidx.work:work-runtime-ktx:[2.1.0].
運行 dependencies
可以打印整個APP的直接與間接引用
果然在這里找到了引用
+--- androidx.work:work-testing:2.1.0
| +--- androidx.work:work-runtime-ktx:[2.1.0] -> 2.1.0
-------------在 androidx.work:work-testing:2.1.0 中 exclude 一下就好了
androidTestImplementation ('androidx.work:work-testing:2.1.0',{
//androidx.work:work-runtime-ktx:[2.1.0]
exclude group: 'androidx.work', module: 'work-runtime-ktx'
})