Testing Singh
Testing Singh

Reputation: 1353

Android Espresso 2.2.1 Resolved versions for app and test app differ

Running tests via Android Studio, Gradle

Espresso:

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'

Library:

androidTestCompile 'com.android.support.test:testing-support-lib:0.1'

Runner:

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Error:A problem occurred configuring project ':application'.

> Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app and test app differ.

Upvotes: 0

Views: 718

Answers (2)

piotrek1543
piotrek1543

Reputation: 19351

Get comfortable with command-line Gradle. This tool help you find any conflicting dependencies when you run from console that command gradle -q app:dependencies.

Instead of deleting androidTestCompile 'com.android.support.test:testing-support-lib:0.1' from your app's build.gradle file, you can add exclude part like here.

androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.0') {
                   exclude module: 'support-annotations'

}

Hope it help.

Upvotes: 0

denys
denys

Reputation: 6910

Just remove the androidTestCompile 'com.android.support.test:testing-support-lib:0.1' from your build.gradle. Take a look on example here.

Upvotes: 1

Related Questions