Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZipException: duplicate entry : com.nineoldandroids

I added ResideMenu in my project using its gradle dependency. but i am getting this issue :

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/nineoldandroids/animation/Animator$AnimatorListener.class

when i checked the external libraries i found that library-2.4.0 and resideMenu-1.6 both contains com.nineoldandroids :

enter image description here

I went through almost all similar problems here on stackoverflow and tried the solutions. Can anyone tell me what needs to be done to remove this issue.

Below are the dependencies that i am using in my project :

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.pnikosis:materialish-progress:1.7'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.wrapp.floatlabelededittext:library:0.0.6'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.specyci:residemenu:1.6+'
}
like image 830
Pro Mode Avatar asked Sep 30 '16 06:09

Pro Mode


2 Answers

You can exclude nineoldandroids from one your your dependencies. i.e:

Change below:

compile 'com.specyci:residemenu:1.6+'

With this:

compile ('com.specyci:residemenu:1.6+') {
    exclude group: 'com.nineoldandroids', module: 'library'
}

NOTE: To list all sub dependencies tree, use gradle dependencies or gradlew dependencies commands. Then you can get the correct group and module names for the library which you want to exclude.

like image 161
Devrim Avatar answered Sep 26 '22 02:09

Devrim


Adding exclude command with another library resolved the issue :

compile ('com.wrapp.floatlabelededittext:library:0.0.6'){
        exclude group: 'com.nineoldandroids', module: 'library'    }
    compile ('com.specyci:residemenu:1.6+') {
        exclude group: 'com.nineoldandroids', module: 'library'    }
like image 32
Pro Mode Avatar answered Sep 24 '22 02:09

Pro Mode