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 \'
annotation library is used by all three dependancies rules:0.5', runner:05 and espresso-core:2.2.2, so following worked for me
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'
}
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}