This entry in my gradle file:
androidTestCompile ('com.squareup.okhttp:mockwebserver:2.7.0')
causes an error:
Warning:Conflict with dependency 'com.squareup.okio:okio'. Resolved versions for app (1.8.0) and test app (1.6.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
I tried commenting out compilation entries in the gradle file to find out which one is inconsistent, but I just can't find which one uses com.squareup.okio: okio.
UPDATE: I was able to get the dependencies by doing: gradlew.bat app: dependencies> c: \ tmp \ output.txt
+
| \
| \
| +
| | \
So, as you can see, retrofit 2.0 uses okhttp3, which uses okio: 1.8.0. Mockwebserver: 2.7.0, on the other hand, uses okhttp: 2.7.0, which uses okio: 1.6.0. So how can I solve this?
Here are the entries in the "dependencies" section of my gradle file:
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.+'
compile 'com.squareup.retrofit2:adapter-rxjava:2.+'
compile 'com.squareup.retrofit2:retrofit-mock:2.+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile (
[group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.4.1']
)
compile 'com.google.dagger:dagger:2.7'
apt 'com.google.dagger:dagger-compiler:2.7'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.facebook.stetho:stetho:1.4.1'
compile 'com.facebook.stetho:stetho-okhttp3:1.4.1'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
testCompile "org.robolectric:robolectric:3.2.2"
testCompile "org.mockito:mockito-core:2.+"
testCompile('org.hamcrest:hamcrest-core:1.3')
testCompile('org.hamcrest:hamcrest-library:1.3')
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile( 'com.android.support.test.espresso:espresso-web:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
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'
})
testCompile ('org.powermock:powermock-api-mockito:1.6.2') {
exclude module: 'hamcrest-core'
exclude module: 'objenesis'
}
androidTestCompile ('com.squareup.okhttp:mockwebserver:2.7.0')
androidTestCompile 'com.squareup.spoon:spoon-client:1.2.0'
source
share