I came across this exception while adding espresso to an android project. I already try the link that comes with this exception
**Conflict with dependency \'
Nowadays when you create a new project on Android Studio, it adds this dependency by default:
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
The exclude
section is probably to avoid the conflict mentioned in the question. I also faced this issue when trying to add runner:0.5
and rules:0.5
dependencies. My solution was to apply the same piece of code above on them:
androidTestCompile ('com.android.support.test:runner:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile ('com.android.support.test:rules:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
})
It works for me. Hope it helps.