有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

任务:app:transformClassesWithJarMergingForDebug的java执行失败

我目前正在开发一款安卓应用程序,但每当我尝试加载某些jar文件时,就会出现以下错误:

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

这是我的gradle档案

apply plugin: 'com.安卓.application'

安卓 {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "company.example.com.mobileapp"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.安卓.support:appcompat-v7:23.1.0'
compile 'com.安卓.support:design:23.1.0'
compile files('libs/apache-httpcomponents-httpclient.jar')
compile files('libs/apache-httpcomponents-httpcore.jar')
//compile files('libs/java-json.jar')
//compile files('libs/安卓-support-v4.jar')
compile files('libs/commons-codec-1.10.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/commons-lang3-3.4.jar')
}

共 (1) 个答案

  1. # 1 楼答案

    尝试清理你的项目

    Build -> Clean Project

    清洁后再次运行