好吧,我知道,类似的问题已被问过多次,但我找不到解决我的问题的方法。 我需要测试我的应用程序。所以我按照教程告诉我添加 Android runnter 支持。
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
问题是,这似乎与我的兼容库不兼容。
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
但是由于我们是针对 API 级别 25 进行开发的,因此需要这些库。所以我认为回到版本 23 不是一个选择。
那么我怎样才能让它运行呢?我错过了什么吗?
最佳答案
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
请参阅旧版本的supportAnnotations
:
com.android.support:support-annotations:23.1.1
您有几个选择:
专门声明用于测试编译的
suportAnnotations
版本(以覆盖任何传递依赖项):androidTestCompile 'com.android.support:support-annotations:25.0.1'
将其从这些依赖项中排除:
androidTestCompile ('com.android.support.test:runner:0.5') { exclude module: 'support-annotations' } androidTestCompile ('com.android.support.test:rules:0.5') { exclude module: 'support-annotations' }
关于android - 警告 :Conflict with dependency 'com.android.support:support-annotations' (25. 0.1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40613068/