与依赖项"com.android.support:support-annotations"冲突.应用(23.3.0)和测试应用(23.1.1)的已解决版本不同 [英] Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.3.0) and test app (23.1.1) differ
本文介绍了与依赖项"com.android.support:support-annotations"冲突.应用(23.3.0)和测试应用(23.1.1)的已解决版本不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在将浓缩咖啡添加到android项目时遇到了此异常.我已经尝试了此异常附带的链接
I came across this exception while adding espresso to an android project. I already try the link that comes with this exception
**Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.3.0) and test app (23.1.1) differ**
我还根据发现的其他线程添加了以下行
also I add the following line according to other thread I found
**androidTestCompile 'com.android.support:support-annotations:23.1.0'**
但是问题仍然存在.我正在使用以下配置:
But the problem still persist. I am using the following configurations:
buildToolsVersion "23.0.2"
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
任何想法,谢谢.
推荐答案
这为我解决了应用(24.0.0-beta1)和测试应用(23.0.1)的已解决版本不同"的问题.
This solve the problem 'Resolved versions for app (24.0.0-beta1) and test app (23.0.1) differ' for me.
android{
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.0.1'
}
}
如果您要运行AndroidTest,请不要忘记添加以下代码
And do not forget to add following code, if you want to run the AndroidTest
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
这篇关于与依赖项"com.android.support:support-annotations"冲突.应用(23.3.0)和测试应用(23.1.1)的已解决版本不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文