android ERROR: Unable to resolve dependency for xxx Could not resolve xxxx Disable offline mode and sync project


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'
})



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM