Error:Conflict with dependency 'com.android.support:support-annotations' in proj

NathansLiu發表於2017-12-23

Error:Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (25.3.1) and test app (26.0.2) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Error:Conflict with dependency 'com.android.support:support-annotations' in proj

庫版本問題

androidTestCompile 'com.android.support.test:runner:0.4.1'

androidTestCompile 'com.android.support.test:rules:0.4.1'

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'複製程式碼

若build中是上面這樣寫的,就改成下面這樣

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
複製程式碼


Error:Conflict with dependency 'com.android.support:support-annotations' in proj

相關文章