0

I can not build apk file. this is my error:

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

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

 compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.eyalbira.loadingdots:loading-dots:1.0.2'
compile 'com.wang.avi:library:2.1.3'
compile 'com.gordonwong:material-sheet-fab:1.2.1'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'co.ronash.android:pushe-base:1.3.4'
compile 'me.leolin:ShortcutBadger:1.1.19@aar'
compile 'com.alexzh:circleimageview:1.2.0'
testCompile 'junit:junit:4.12'

and these are my libs:

enter image description here

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
Pegah Ahmadvand
  • 97
  • 2
  • 10

2 Answers2

0

This is because your dependencies have a duplicated nineoldandroids library.

You need to exclude it from your dependencies. One of the library containing nineoldandroids is circleimageview. You can exclude the library with:

compile ('com.alexzh:circleimageview:1.2.0') {
   exclude group: 'com.nineoldandroids', module: 'library'
}

You need to find the other library which contains the nineoldandroid library.

A lazy solution is using configurations block in your module build.gradle (I really don't encourage to use the configurations):

configurations {
    // to avoid double inclusion of support libraries
    all*.exclude group: 'com.nineoldandroids', module: 'library'
}

dependencies {
  ...
}
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
0

I solved it:

compile ('com.gordonwong:material-sheet-fab:1.2.1') {
           exclude group: 'com.nineoldandroids', module: 'library'}
Pegah Ahmadvand
  • 97
  • 2
  • 10