Android Espresso Issue - Dependency conflict

前端 未结 8 1896
Happy的楠姐
Happy的楠姐 2021-02-12 16:34

I\'m trying to integrate espresso into my application for ui testing. Here are my dependencies in Gradle

dependencies {
    compile fileTree(dir: \'libs\', inclu         


        
8条回答
  •  你的背包
    2021-02-12 17:14

    Latest versions of androidTest dependencies depend on appropriate version of support-annotations lib. In my case it is:

    androidTestCompile 'com.android.support.test:runner:0.4'
    androidTestCompile 'com.android.support.test:rules:0.4'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
    androidTestCompile 'org.mockito:mockito-core:2.0.31-beta'
    

    Also, as a workaround you can add the next code in your build.gradle, android{} section:

    configurations.all {
       resolutionStrategy {
           force 'com.android.support:support-annotations:23.0.1'
       }
    }
    

提交回复
热议问题