【发布时间】:2015-08-04 10:43:39
【问题描述】:
我正在尝试将 espresso 集成到我的应用程序中以进行 ui 测试。这是我在 Gradle 中的依赖项
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.1'
compile 'com.github.bumptech.glide:okhttp-integration:1.3.1@aar'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:cardview-v7:21.+'
compile 'com.android.support:recyclerview-v7:21.+'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
compile 'com.android.support:support-annotations:22.2.0'
androidTestCompile 'com.android.support.test:runner:0.3'
compile project(':common')
compile project(':service')
}
所以我所有的 espresso 依赖项都包括在内。但是,当我尝试构建时,出现此错误:
Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.2.1) and test app (22.2.0) differ.
有人遇到过吗?我发现它报告了here,但是没有解决方案。有没有人解决这个问题?
【问题讨论】:
-
解决方法是使用'configurations.all { resolutionStrategy.force 'com.android.support:support-annotations:22.1.0' }'
-
嘿,您必须从每个 espresso 依赖项中删除 android.support 依赖项。检查:stackoverflow.com/questions/29857695/…
标签: android android-gradle-plugin android-espresso