2

After updating to android studio 2.1 and while i tried to use new gradle my project started crashing with kinda that:

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

Gradle:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "application.id.is.here"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding
            {
                enabled = true
            }
    dexOptions {
        javaMaxHeapSize "4g"
        preDexLibraries = true
    }
}

    repositories {
    mavenCentral()
}

    dependencies {
     //compile fileTree(dir: 'libs', include: ['*.jar'])
     compile('com.mikepenz:materialdrawer:4.6.4@aar') {
        transitive = true
     }
    compile 'com.android.support:multidex:1.0.1+'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.android.support:design:23.1.1'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.vk:androidsdk:+'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.tools.build:gradle:2.1.0+'
    compile ('com.google.android.gms:play-services-maps:8.3.0'){
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.7.2+'
 }

    configurations {
        all*.exclude group: 'commons-logging', module: 'commons-logging'
    }

and Top-level build:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
    }
}

allprojects {
    repositories {
        jcenter()
    }

    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

If you have any ideas - please help. None of solvations i found for this problem worked out for me.

1 Answers1

0

Igor's answer worked for me. I had the exact same issue (after getting all those exclusions in there). Kind of a pain getting Android Studio 2.1 running.

Quit Android Studio then clear caches:

cd ~/.gradle/caches
rm -r *

Restart Android Studio and now it should work.

hichris123
  • 9,735
  • 15
  • 51
  • 66
PsychicPuppy
  • 147
  • 1
  • 7