Gradle build failed: java.util.zip.ZipException: doppelter Eintrag: org/apache/commons/io/CopyUtils.class

Beim ausführen der app auf meinem nexus 7, das gradle-build schlägt fehl, und jedes mal gibt den gleichen Fehler:

> com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
org/apache/commons/io/CopyUtils.class

Der Fehler scheint zu zeigen, dass CopyUtils.class aus commons-io wird zweimal in den build-Prozess.

Vollständigen Protokoll:

Information:Gradle tasks [:android:assembleDebug]

:android:preBuild UP-TO-DATE

:android:preDebugBuild UP-TO-DATE

:android:checkDebugManifest

:android:preReleaseBuild UP-TO-DATE

:android:prepareComAndroidSupportMultidex101Library UP-TO-DATE

:android:prepareDebugDependencies

:android:compileDebugAidl UP-TO-DATE

:android:compileDebugRenderscript UP-TO-DATE
:android:generateDebugBuildConfig UP-TO-DATE

:android:mergeDebugShaders UP-TO-DATE

:android:compileDebugShaders UP-TO-DATE

:android:generateDebugAssets UP-TO-DATE

:android:mergeDebugAssets UP-TO-DATE

:android:generateDebugResValues UP-TO-DATE


:android:generateDebugResources UP-TO-DATE

:android:mergeDebugResources UP-TO-DATE

:android:processDebugManifest UP-TO-DATE

:android:processDebugResources UP-TO-DATE

:android:generateDebugSources UP-TO-DATE

:android:incrementalDebugJavaCompilationSafeguard UP-TO-DATE

:android:compileDebugJavaWithJavac UP-TO-DATE

:android:compileDebugNdk UP-TO-DATE

:android:compileDebugSources UP-TO-DATE

:android:prePackageMarkerForDebug
:android:transformClassesWithJarMergingForDebug FAILED
Error:Execution failed for task 
':android:transformClassesWithJarMergingForDebug'.

> com.android.build.api.transform.TransformException: 
java.util.zip.ZipException: duplicate entry: 
org/apache/commons/io/CopyUtils.class

Information:BUILD FAILED

Information:Total time: 11.208 secs

Information:1 error

Information:0 warnings

Information:See complete output in console

Auch meine bauen.gradle:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"


    defaultConfig {
        applicationId "org.wildstang.wildrank.android"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

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

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.+'
    compile 'com.android.support:support-v13:19.+'
    compile 'de.congrace:exp4j:0.3.+'
    compile 'org.apache.commons:commons-io:1.3.+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

Ich scheine jetzt bekommen

Error:(43, 0) Gradle DSL-Methode nicht gefunden: 'com.android.support:support-v4:24.1.1()'
Mögliche Ursachen:

  • Das Projekt "wildrank-android-master' kann mit einer version von Gradle, die nicht enthalten die Methode.
    Öffnen Gradle-wrapper-Datei
  • Der build-Datei fehlt möglicherweise ein Gradle-plugin.
    Gelten Gradle-plugin
  • Meinem Gradle-wrapper

    Wed Jul 06 21:02:27 PDT 2016

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists

    zipStoreBase=GRADLE_USER_HOME

    zipStorePath=wrapper/dists

    distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip

    Meine neue gradle-Datei

    apply plugin: 'com.android.die Anwendung' //WICHTIG: 'com.android.Anwendung' nicht

    android {
    compileSdkVersion 24 //compile sdk sollte immer die Letzte
    buildToolsVersion "24.0.1" //weiß nicht, ob diese Fragen

    defaultConfig {
        applicationId "org.wildstang.wildrank.android"
        minSdkVersion 14
        targetSdkVersion 19 //Looks like this is a new app, why are you using 19 and not 24?
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    
    lintOptions {
        abortOnError false
    }

    }

    Abhängigkeiten {
    kompilieren Dateibaum(include: ['*.jar'], dir: 'libs') //WICHTIG

    //Ignore these, I don't think they are important for you, but I needed them to get my test project to compile
    //These version numbers worked for me:
    compile 'com.android.support:support-v4:24.1.1'{exclude group: 'org.apache.commons', module: 'commons-io' }
    compile 'com.android.support:support-v13:24.1.1'{ exclude module: 'commons-io' }
    compile 'de.congrace:exp4j:0.3.11'{ exclude module: 'commons-io' }
    compile 'org.apache.commons:commons-io:1.3.2'{ exclude module: 'commons-io' }

    }

    Schreibe einen Kommentar