Android Espresso问题-依赖冲突 [英] Android Espresso Issue - Dependency conflict

查看:134
本文介绍了Android Espresso问题-依赖冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将espresso集成到我的应用程序中以进行ui测试.这是我在Gradle中的依赖项

I'm trying to integrate espresso into my application for ui testing. Here are my dependencies in 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')
}

因此包括了我所有的意式浓缩咖啡.但是,当我尝试构建时,出现此错误:

So all my espresso dependencies are included. However when I try to build I get this error:

Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.2.1) and test app (22.2.0) differ.

有人遇到过这个吗?我发现它在此处中报告了该问题,但是没有解决方法.有人对此有解决办法吗?

Has anyone encountered this? I've found it reported here however there's no resolution. Does anyone have a fix for this?

推荐答案

因此,在进行大量挖掘之后,我发现需要更改支持注释的依赖性.

So after a lot of digging around, I found I needed to change the dependency for the support annotations.

所以我需要改变 compile 'com.android.support:support-annotations:22.2.0'androidTestCompile 'com.android.support:support-annotations:22.+'

So I needed to change compile 'com.android.support:support-annotations:22.2.0' to androidTestCompile 'com.android.support:support-annotations:22.+'

这篇关于Android Espresso问题-依赖冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆