Donovan Tan
Donovan Tan

Reputation: 326

Android: Execution failed for task ':app:transformClassesWithJarMergingForDebug'

does anyone knows how to resolve this? I uses Android Studio 1.5.1 and the following error pops out when I try to run my application.

Below is the error shown in my Messages Gradle Build:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/CallSuper.class

For this error I have tried searching online for several solutions like: - Cleaning the project from Android menu (Build > Clean) - Cleaning gradle from cmd (project_source/gradlew clean) - Restarting Android Studio - Checking for any duplicates in dependencies in "build.gradle"

However, none of the above works for me.

Below is my build.gradle file:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'

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

apply plugin: 'io.fabric'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.l33902.contactmanagment1512"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

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

    useLibrary 'org.apache.http.legacy'

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.prolificinteractive:material-calendarview:0.7.0'

    compile files('libs/json_simple-1.1.jar')
    compile files('libs/jtar-1.1.jar')
    compile files('libs/microsoft-translator-java-api-0.6-mod.jar')
    compile project(':libraries:tess-two')

    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.2@aar') {
        transitive = true;
    }
    crashlytics {
        enableNdk true
        androidNdkOut 'src/main/obj'
        androidNdkLibsOut 'src/main/libs'
    }

}

crashlytics {
    enableNdk true
    androidNdkOut 'src/main/obj'
    androidNdkLibsOut 'src/main/libs'
}

Upvotes: 0

Views: 1040

Answers (1)

KCN
KCN

Reputation: 462

compile 'com.android.support:support-v4:23.1.1'  

Exclude this dependency and try .I think it showing error because your using both v4 and v7 dependencies. You can use either v7 or v4 dependencies.

Upvotes: 1

Related Questions