0

I have this problem when i will to compile my project: And when i will build my project to APK i have this error:

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

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/tree/AbstractInsnNode.class

This is my gradle.


apply plugin: 'com.android.application'


buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "come.texi.driver"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 2
        versionName "2.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }


}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    //    compile 'com.jakewharton:butterknife:7.0.1'
    //compile 'com.loopj.android:android-async-http:1.4.9'



    compile project(':facebooklibrary')
    compile project(':slideMenuLibrary')
    compile project(':stripe')
    compile('com.twitter.sdk.android:twitter:1.13.0@aar') {
        transitive = true
    }
    //compile 'com.github.nkzawa:socket.io-client:0.3.0'
    compile('io.socket:socket.io-client:0.7.0') {
        // excluding org.json which is provided by Android
        exclude group: 'org.json', module: 'json'
    }
    //compile 'com.paypal.sdk:paypal-android-sdk:2.14.4'
    compile('com.paypal.sdk:paypal-android-sdk:2.14.4') {
        exclude group: 'org.json', module: 'json'
    }

    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'cz.msebera.android:httpclient:4.4.1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.koushikdutta.ion:ion:2.+'
    compile 'com.victor:lib:1.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    compile 'com.google.android.gms:play-services-analytics:9.4.0'
    compile 'com.google.android.gms:play-services-gcm:9.4.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.tools.build:gradle:2.2.3'
    testCompile 'junit:junit:4.12'
}

Help me!!

  • Follow this link: http://stackoverflow.com/questions/26966843/java-util-zip-zipexception-duplicate-entry-during-packagealldebugclassesformult – Rohit Sharma Dec 13 '16 at 13:09
  • Try Invalidate caches and Restart from the Android Studio File menu. – Madhan Dec 13 '16 at 13:12
  • compile 'com.android.tools.build:gradle:2.2.3' - This should not be here. It should be in the build.gradle file of Project's root module. Should be like this dependencies { classpath 'com.android.tools.build:gradle:2.2.3' } – Madhan Dec 13 '16 at 13:14
  • Thankss Madhan, i found the problem. I just remove compile 'com.android.tools.build:gradle:2.2.3' – Wesley Igor Dec 13 '16 at 13:25

1 Answers1

0

I had the exact same problem, except I am using Android Gradle Plugin 2.3.3, but that's not the issue. Here is how I solved it, hope this will help you.

Inside android, add the packagingOptions to exclude AUTHORS like this:

android {
   packagingOptions {
      exclude 'AUTHORS'
   }
}

Here is some documentation reference

Paul Wang
  • 157
  • 2
  • 3