square / leakcanary

A memory leak detection library for Android.
https://square.github.io/leakcanary
Apache License 2.0
29.34k stars 3.97k forks source link

Error java.util.zip.ZipException: duplicate entry: com/squareup/leakcanary/watcher/R.class #819

Closed EgorChe closed 7 years ago

EgorChe commented 7 years ago

Hello!

When i add library in my project i get appears: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/squareup/leakcanary/watcher/R.class

Libraries in project: compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:design:25.3.1' compile 'com.google.code.gson:gson:2.7' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.squareup.okhttp3:okhttp:3.8.0' compile 'com.squareup.okhttp3:logging-interceptor:3.8.0' compile 'com.mikepenz:fontawesome-typeface:4.6.0.1@aar' compile 'com.google.android.gms:play-services-maps:10.2.1' compile 'com.google.android.gms:play-services-location:10.2.1' compile 'com.android.support:multidex:1.0.1' compile 'com.yalantis:ucrop:2.2.0-native' compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') { transitive = true; } compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.jakewharton:butterknife:8.4.0' compile 'com.rengwuxian.materialedittext:library:2.1.4' compile 'com.hedgehog.ratingbar:app:1.1.2' compile 'org.greenrobot:eventbus:3.0.0' compile('com.google.firebase:firebase-messaging:10.2.1') { exclude group: 'com.google.android.gms' } compile 'com.firebase:firebase-jobdispatcher:0.5.2' compile 'com.squareup.okhttp3:mockwebserver:3.8.1'

//Test
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.4'
testCompile 'org.robolectric:shadows-multidex:3.0'
testCompile 'org.assertj:assertj-core:1.7.0'
testCompile 'org.mockito:mockito-core:1.9.5'
compile 'com.squareup.leakcanary:leakcanary-android:1.5.2'
JakeWharton commented 7 years ago

Dupe #815

852172891 commented 7 years ago

old is Error In my build.gradle: debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.2' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.2'

now right In my build.gradle: compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.2'