0

我需要在我正在开发的项目中编写一些自动化测试。所以,我只是复制了一些谷歌的例子所需要的依赖:如何找出我需要哪个版本的com.android.support.test依赖关系?

androidTestCompile 'com.android.support.test:runner:0.5' 
androidTestCompile 'com.android.support.test:runner:0.5' 
androidTestCompile 'com.android.support.test:rules:0.5' 

// Espresso UI Testing dependencies. 
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2' 
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2' 

我跑进了东西,你会发现在一百万的问题上,所以这个问题:

Warning:Conflict with dependency 'com.android.support:recyclerview-v7'. Resolved versions for app (25.3.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details. 

在这里,我不问了测试运行器的所需版本,测试规则和其他测试依赖性,以便能够同步Gradle并继续前进。

我的问题。有什么快速的方法可以看到com.android.support.test:runner,com.android.support.test:rules等依赖于Support Library 25.3.0的版本吗?

当然,我可以继续使用0.60.7等代替0.5,直到Gradle同步成功,但这很无聊,需要我很长时间。

回答

0

简短的回答是,目前没有一个版本取决于支持库25.3.0,因为支持库的版本在官方稳定测试工件之后很久才发布。

如果您希望能够在将来的版本中识别此问题,则需要查看每个工件的传递依赖关系。您可以通过运行在Maven POM文件看到这些,或者通过gradle这个:

gradle :your_module_name:dependencies

这就是说,你通常可以通过告诉gradle这个忽略咖啡的传递依赖这样使用支持库的任何版本:

androidTestCompile("com.android.support.test.espresso:espresso-contrib:2.2.2") { 
    exclude group: 'com.android.support', module: 'appcompat' 
    exclude group: 'com.android.support', module: 'support-v4' 
    exclude module: 'recyclerview-v7' 
} 

可以使用依赖关系的gradle以便找出哪些咖啡伪影在被引起冲突的传递依赖拉动上述命令。

相关问题