Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':app:transformClassesWithMultidexlistForDebug' Duplicate Zip Entry

I am getting the below error all of a sudden. The app was running fine till morning. Since then I have been getting this. I tried loading older commits from Git, however I am getting the same issue now. I can see that there's a duplicate entry of some class, but it is not very clear where. I have checked all of my libraries to locate the issue but in vain. Please help

Error:Execution failed for task 
':app:transformClassesWithMultidexlistForDebug'.
> java.io.IOException: Can't write [C:\Users\Bluetie Backup 3 
i5\Downloads\Bluetie_Android_NewDesign-
Development\Bluetie_Android_NewDesign-Development\BlueTieAndroid-
master\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't 
read [C:\Users\Bluetie Backup 3 i5\.gradle\caches\transforms-1\files-
1.1\support-core-ui-27.1.0.aar\781c80d72f0634c3cfc30b7ab8014102\jars\classes.jar(;;;;;;**.class)] 
(Duplicate zip entry[classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]))`

I have used a lot of Libraries as my app is very UI centric.

Here's the build.gradle file

compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':rtp')
compile project(':pageIndicator')
compile files('libs/linkedin-j-android.jar')
//compile files('libs/commons-codec-1.3.jar')
//compile files('libs/signpost-core-1.2.1.1.jar')
compile project(':imagepicker')
compile project(':swipflingview')

compile project(':linkedin-sdk')
compile 'com.android.support:multidex:1.0.2'
//noinspection GradleCompatible
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-crash:11.0.2'
/* compile 'com.google.firebase:firebase-auth:11.0.2'*/
compile 'com.google.android.gms:play-services-analytics:11.0.2'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
/*compile 'com.google.android.gms:play-services-ads:11.0.2'*/
compile 'com.google.android.gms:play-services-auth:11.0.2'
/*  compile 'com.google.android.gms:play-services-gcm:11.0.2'*/
compile 'com.google.android.gms:play-services-places:11.0.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.okio:okio:1.0.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:design:26.1.0'
compile ('com.facebook.android:facebook-android-sdk:4.6.0'){
    exclude module: 'support-v4'
}
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.yalantis:ucrop:2.2.0'
compile 'com.appyvet:materialrangebar:1.3'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.2.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'com.jsibbold:zoomage:1.1.0'
compile 'com.michaelmuenzer.android:ScrollableNumberPicker:0.2.2'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
compile ('com.nineoldandroids:library:2.4.0'){
    exclude module: 'support-v4'
}
compile 'uk.co.samuelwall:material-tap-target-prompt:1.1.4'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.android.support:percent:26.1.0'
compile('com.github.ozodrukh:CircularReveal:1.1.1') {
    transitive = true;
}
testCompile 'junit:junit:4.12'
compile project(':paralaxed_viewpager')
compile project(':tooltiplibrary'){
    exclude module: 'support-v4'
}
compile project(':pinview_lib')
compile 'com.github.travijuu:numberpicker:1.0.7'
compile 'com.razorpay:checkout:1.4.1'

compile 'com.github.travijuu:numberpicker:1.0.7'
compile 'com.razorpay:checkout:1.4.1'
compile project(':country_code_picker_library')
compile 'com.github.satyan:sugar:1.5'
compile 'org.igniterealtime.smack:smack-android:4.1.6'
compile 'org.igniterealtime.smack:smack-tcp:4.1.6'
compile 'org.igniterealtime.smack:smack-im:4.1.6'
compile 'org.igniterealtime.smack:smack-extensions:4.1.6'
compile 'com.jackandphantom.android:circularprogressbar:1.2.0'
compile 'com.jaredrummler:material-spinner:1.2.4'
compile 'com.skyfishjy.ripplebackground:library:1.0.1'

compile 'com.wonderkiln:camerakit:0.13.1'
compile 'com.droidninja:filepicker:2.1.2'
compile project(':autocompleteview')
compile 'com.appsflyer:af-android-sdk:4.8.7@aar'
compile 'com.android.installreferrer:installreferrer:1.0'
like image 856
Akash Hajare Avatar asked Dec 19 '22 00:12

Akash Hajare


2 Answers

Just change the version of a dependency-

from

compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'

to

compile 'com.theartofdev.edmodo:android-image-cropper:2.5.1'

Sync >> Clean >> Rebuild , and Done

In my case this changes fixed my issue.

like image 53
Deven Avatar answered Dec 30 '22 13:12

Deven


This error appeared after Android released Support Library v27.1.0 (February 2018).

I think, this error is because of some dependencies used in the project.

compile 'com.another.library:1.2.3'
compile '.....'

Since every dependency is another project, with its own dependencies. Android tries to add all of these to the project, when building. If a dependency uses another version of a support library, this kind of conflicts or duplicates may occur.

Probably one of your dependencies has a line in its gradle file, declaring:

 compile 'com.android.support:design:27.+'

which means "use the newest release of v.27".

When v.27.1.0 has been released your own compile 'com.android.support:...:26.1.0' lines caused a duplicate.

To solve this out:

You can either update your own dependencies to the new version

or

-if you are able to find- you can exclude the support libraries from the dependency using v.27.1.0:

compile('com.another.library:1.2.3') {
    exclude group: 'com.android.support', module: 'support-v13'
}
like image 24
JustADeveloper Avatar answered Dec 30 '22 11:12

JustADeveloper