Android:执行失败的任务':app:transformClassesWithJarMergingForDebug'

时间:2016-01-12 04:20:18

标签: android android-studio gradle

有谁知道如何解决这个问题?我使用的是Android Studio 1.5.1,当我尝试运行我的应用程序时会弹出以下错误。

以下是我的消息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

对于此错误,我尝试在线搜索以下几种解决方案:   - 从Android菜单清理项目(Build> Clean)   - 从cmd清理gradle(project_source / gradlew clean)   - 重新启动Android Studio   - 检查" build.gradle"

中依赖项的任何重复项

但是,以上都不适用于我。

以下是我的build.gradle文件:

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'
}

1 个答案:

答案 0 :(得分:1)

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

排除此依赖项并尝试。我认为它显示错误,因为您使用了v4和v7依赖项。您可以使用v7或v4依赖项。