4

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+'
}
Pro Mode
  • 1,453
  • 17
  • 30
  • You should create a bug issue in both projects (library-2.4.0 and resideMenu-1.6) because nineoldandroids should not be included in their JARs, instead the [maven package](https://mvnrepository.com/artifact/com.nineoldandroids/library) should be referenced as dependecy. – Robert Sep 30 '16 at 06:45

3 Answers3

4

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.

Devrim
  • 15,345
  • 4
  • 66
  • 74
2

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'    }
Pro Mode
  • 1,453
  • 17
  • 30
0

You must first add the ResideMenu library manually to your project. Then open the Gradle file from the ResideMenu library. On the dependencies,clean of the compile fileTree line (dir: 'libs', include: ['* .jar']) And replace the line below: compile 'com.nineoldandroids:library:2.4.0'