I'm trying to use the new DiffUtil class that was introduced in recyclerview-v7:24.2.0.
However, I've discovered that updating my dependencies in my build.gradle makes it so that I can no longer run my app.
Below is my current list of dependencies which will build:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:24.2.0'
androidTestCompile 'com.android.support:support-annotations:24.2.0'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
compile 'com.github.siyamed:android-shape-imageview:0.9.3@aar'
compile 'com.neovisionaries:nv-websocket-client:1.12'
compile 'com.nightonke:jellytogglebutton:1.0.2'
compile 'com.squareup.okhttp3:okhttp:3.4.0-RC1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile('com.github.ozodrukh:CircularReveal:1.3.1@aar') {
transitive = true;
}
compile 'com.jakewharton:butterknife:8.1.0'
apt 'com.jakewharton:butterknife-compiler:8.1.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile "com.github.fge:json-patch:1.9"
apt 'com.squareup:javapoet:1.7.0'
apt 'com.google.dagger:dagger-compiler:2.2'
compile 'com.google.dagger:dagger:2.2'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.github.pwittchen:reactivenetwork:0.5.0'
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.10.19"
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
transitive = true;
}
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
}
All I do is change the one version number from 24.1.1 to 24.2.0 like so:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:24.2.0'
androidTestCompile 'com.android.support:support-annotations:24.2.0'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
compile 'com.github.siyamed:android-shape-imageview:0.9.3@aar'
compile 'com.neovisionaries:nv-websocket-client:1.12'
compile 'com.nightonke:jellytogglebutton:1.0.2'
compile 'com.squareup.okhttp3:okhttp:3.4.0-RC1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile('com.github.ozodrukh:CircularReveal:1.3.1@aar') {
transitive = true;
}
compile 'com.jakewharton:butterknife:8.1.0'
apt 'com.jakewharton:butterknife-compiler:8.1.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile "com.github.fge:json-patch:1.9"
apt 'com.squareup:javapoet:1.7.0'
apt 'com.google.dagger:dagger-compiler:2.2'
compile 'com.google.dagger:dagger:2.2'
provided 'javax.annotation:jsr250-api:1.0'
compile 'com.github.pwittchen:reactivenetwork:0.5.0'
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.10.19"
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
transitive = true;
}
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
}
If I make this change, my build fails with the following error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/view/PagerTitleStrip$PageListener.class
I've tried setting up various exclusions for support modules, and I've tried using different prefixes for compilation (like androidTestCompile vs compile).
If anyone could make sense if what's going on and help me out, I'd be eternally grateful. Thanks.