Tôi đang cố gắng tích hợp espresso vào ứng dụng của mình để kiểm tra ui. Dưới đây là các phụ thuộc của tôi trong GradleVấn đề về Espresso Android - Xung đột phụ thuộc
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.1'
compile 'com.github.bumptech.glide:okhttp-integration:[email protected]'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:cardview-v7:21.+'
compile 'com.android.support:recyclerview-v7:21.+'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
compile 'com.android.support:support-annotations:22.2.0'
androidTestCompile 'com.android.support.test:runner:0.3'
compile project(':common')
compile project(':service')
}
Vì vậy, tất cả các phụ thuộc espresso của tôi được bao gồm. Tuy nhiên khi tôi cố gắng xây dựng tôi nhận được lỗi này:
Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (22.2.1) and test app (22.2.0) differ.
Có ai gặp phải điều này? Tôi đã tìm thấy nó báo cáo here tuy nhiên không có độ phân giải. Có ai có một sửa chữa cho điều này?
Giải pháp là sử dụng 'configurations.all { resolutionStrategy.force' com .android.support: hỗ trợ-chú thích: 22.1.0 ' }' –
Xin chào, bạn phải xóa phụ thuộc android.support khỏi mỗi phụ thuộc của espresso. kiểm tra: http://stackoverflow.com/questions/29857695/android-tests-build-error-multiple-dex-files-define-landroid-support-test-build –