gpt4 book ai didi

android - 升级到 Espresso 2.1,现在出现依赖冲突

转载 作者:可可西里 更新时间:2023-10-31 22:04:19 25 4
gpt4 key购买 nike

在设置 Espresso 2.1 和最新版本的 Android 测试支持库时,我在构建时遇到了下一个警告:

Confilct with dependency 'com.android.support:support-annotations'. Resolved versions for app and test app differ

我的build.gradle 文件是:

apply plugin: 'com.android.application'

android {
...
defaultConfig {
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
...
}

dependencies {
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support.test:rules:0.2'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.0'
}

最佳答案

实际上我找到了一个 existing issue :

we built against the old 22.0.0 and didn't upgrade to 22.1.0. The runner depends on com.android.support:support-annotations:22.0.0 which conflicts with the latest support library release (22.1.0)

我通过将以下行添加到我的依赖项列表来告诉 gradle 它需要解析哪个版本的支持注释:

androidTestCompile 'com.android.support:support-annotations:22.1.0'

警告消失了。

关于android - 升级到 Espresso 2.1,现在出现依赖冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29820879/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com