美文网首页
AndroidStudio-依赖jar包版本不一致导致冲突

AndroidStudio-依赖jar包版本不一致导致冲突

作者: TMAC_EAH | 来源:发表于2020-11-16 11:22 被阅读0次
解决方案一
(自行搜索 查看依赖树) 类似如下结构
 com.android.support.test.espresso:espresso-core:2.2.2
     +--- com.squareup:javawriter:2.1.1
     +--- com.android.support.test:rules:0.5
     |    \--- com.android.support.test:runner:0.5
     |         +--- junit:junit:4.12
     |         |    \--- org.hamcrest:hamcrest-core:1.3
     |         \--- com.android.support.test:exposed-instrumentation-api-publish:0.5
     +--- com.android.support.test:runner:0.5 (*)
     +--- javax.inject:javax.inject:1
     +--- org.hamcrest:hamcrest-library:1.3
     |    \--- org.hamcrest:hamcrest-core:1.3

>> 使用exclue排除

org.hamcrest:hamcrest-core:1.3

group:org.hamcrest
module:hamcrest-core

implementation('com.android.support.test.espresso:espresso-core:2.2')
             {
                 exclude  group:'org.hamcrest',module: 'hamcrest-core'
             }

解决方案二
android {
   ....

   configurations.all {
        resolutionStrategy {
            force 'com.sinochem.argcx.map:tile:1.0.4' // 强制指定使用某个版本
            force 'com.sinochem.argcx:common:1.0.95'// 强制指定使用某个版本
        }
    }
}

相关文章

网友评论

      本文标题:AndroidStudio-依赖jar包版本不一致导致冲突

      本文链接:https://www.haomeiwen.com/subject/zqvabktx.html