TransformException doppelter Eintrag für common.annotations.Beta

Lesezeit: 8 Minuten

Das fing an, als ich hinzufügte google-api-services-calendar. Ich erhalte diese Fehlermeldung, wenn ich versuche zu bauen:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
     com.android.build.transform.api.TransformException: java.util.zip.ZipException: 
     duplicate entry: com/google/common/annotations/Beta.class

Dies ist ein Teil der Ausgabe beim Ausführen ./gradlew app:dependencies:

compile - Classpath for compiling the main sources.
+--- com.google.android.gms:play-services-measurement:8.1.0
|    +--- com.google.android.gms:play-services-base:8.1.0
|    |    --- com.google.android.gms:play-services-basement:8.1.0
|    |         --- com.android.support:support-v4:22.2.0 -> 23.0.1
|    |              --- com.android.support:support-annotations:23.0.1
|    --- com.google.android.gms:play-services-analytics:8.1.0
|         +--- com.google.android.gms:play-services-basement:8.1.0 (*)
|         --- com.google.android.gms:play-services-ads:8.1.0
|              +--- com.google.android.gms:play-services-basement:8.1.0 (*)
|              --- com.google.android.gms:play-services-appindexing:8.1.0
|                   --- com.google.android.gms:play-services-basement:8.1.0 (*)
+--- com.google.dagger:dagger:2.0
|    --- javax.inject:javax.inject:1
+--- com.google.android.gms:play-services-identity:8.1.0
|    --- com.google.android.gms:play-services-base:8.1.0 (*)
+--- com.google.android.gms:play-services-plus:8.1.0
|    --- com.google.android.gms:play-services-base:8.1.0 (*)
+--- com.google.android.gms:play-services:8.1.0
|    +--- com.google.android.gms:play-services-ads:8.1.0 (*)
|    +--- com.google.android.gms:play-services-analytics:8.1.0 (*)
|    +--- com.google.android.gms:play-services-appindexing:8.1.0 (*)
|    +--- com.google.android.gms:play-services-appinvite:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-appstate:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-basement:8.1.0 (*)
|    +--- com.google.android.gms:play-services-cast:8.1.0
|    |    +--- com.google.android.gms:play-services-base:8.1.0 (*)
|    |    --- com.android.support:mediarouter-v7:22.2.0
|    |         --- com.android.support:appcompat-v7:22.2.0 -> 23.0.1
|    |              --- com.android.support:support-v4:23.0.1 (*)
|    +--- com.google.android.gms:play-services-drive:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-fitness:8.1.0
|    |    +--- com.google.android.gms:play-services-base:8.1.0 (*)
|    |    --- com.google.android.gms:play-services-location:8.1.0
|    |         +--- com.google.android.gms:play-services-base:8.1.0 (*)
|    |         --- com.google.android.gms:play-services-maps:8.1.0
|    |              --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-games:8.1.0
|    |    +--- com.google.android.gms:play-services-base:8.1.0 (*)
|    |    --- com.google.android.gms:play-services-drive:8.1.0 (*)
|    +--- com.google.android.gms:play-services-gcm:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-identity:8.1.0 (*)
|    +--- com.google.android.gms:play-services-location:8.1.0 (*)
|    +--- com.google.android.gms:play-services-maps:8.1.0 (*)
|    +--- com.google.android.gms:play-services-measurement:8.1.0 (*)
|    +--- com.google.android.gms:play-services-nearby:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-panorama:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-plus:8.1.0 (*)
|    +--- com.google.android.gms:play-services-safetynet:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-vision:8.1.0
|    |    --- com.google.android.gms:play-services-base:8.1.0 (*)
|    +--- com.google.android.gms:play-services-wallet:8.1.0
|    |    +--- com.google.android.gms:play-services-base:8.1.0 (*)
|    |    +--- com.google.android.gms:play-services-identity:8.1.0 (*)
|    |    --- com.google.android.gms:play-services-maps:8.1.0 (*)
|    --- com.google.android.gms:play-services-wearable:8.1.0
|         --- com.google.android.gms:play-services-base:8.1.0 (*)
+--- com.google.guava:guava:18.0
+--- com.google.maps.android:android-maps-utils:0.4
+--- com.google.apis:google-api-services-calendar:v3-rev125-1.20.0
|    --- com.google.api-client:google-api-client:1.20.0
|         +--- com.google.oauth-client:google-oauth-client:1.20.0
|         |    +--- com.google.http-client:google-http-client:1.20.0
|         |    |    --- com.google.code.findbugs:jsr305:1.3.9
|         |    --- com.google.code.findbugs:jsr305:1.3.9
|         +--- com.google.http-client:google-http-client-jackson2:1.20.0
|         |    +--- com.google.http-client:google-http-client:1.20.0 (*)
|         |    --- com.fasterxml.jackson.core:jackson-core:2.1.3 -> 2.2.2
|         --- com.google.guava:guava-jdk5:13.0
+--- com.android.support:design:23.0.1
|    +--- com.android.support:support-v4:23.0.1 (*)
|    --- com.android.support:appcompat-v7:23.0.1 (*)
+--- com.android.support:recyclerview-v7:23.0.1
|    +--- com.android.support:support-v4:23.0.1 (*)
|    --- com.android.support:support-annotations:23.0.1
+--- com.android.support:cardview-v7:23.0.1
+--- com.android.support:palette-v7:23.0.1
|    --- com.android.support:support-v4:23.0.1 (*)
+--- com.android.support:appcompat-v7:22.2.0 -> 23.0.1 (*)
+--- com.android.support:support-v4:22.2.0 -> 23.0.1 (*)
+--- com.firebase:firebase-client-android:2.3.1
|    --- com.firebase:firebase-client-jvm:2.3.1
|         +--- com.fasterxml.jackson.core:jackson-databind:2.2.2
|         |    +--- com.fasterxml.jackson.core:jackson-annotations:2.2.2
|         |    --- com.fasterxml.jackson.core:jackson-core:2.2.2
|         --- com.firebase:tubesock:0.0.11
+--- com.firebase:firebase-client-jvm:2.3.0 -> 2.3.1 (*)
+--- net.danlew:android.joda:2.8.0
|    --- joda-time:joda-time:2.8
+--- org.joda:joda-convert:1.2
+--- com.squareup:otto:1.3.5
+--- com.jakewharton:butterknife:7.0.1
+--- org.apache.commons:commons-lang3:3.4
+--- org.apache.commons:commons-collections4:4.0
--- com.bignerdranch.android:expandablerecyclerview:1.0.3
     --- com.android.support:recyclerview-v7:22.2.0 -> 23.0.1 (*)

Ich habe versucht, dies hinzuzufügen alle meine Abhängigkeiten:

compile (some.dependencie.that.may.or.may.not.have.the.duplicate){
    exclude group: 'com.google.common', module: 'annotations'
}

Ich habe versucht, dies zu meinem hinzuzufügen android Block:

configurations {
   all*.exclude group: 'com.google.common', module: 'annotations'
}    

mit diesen Variationen:

 all*.exclude module: 'annotations`
 all*.exclude group: 'com.google.common'
 all*.exclude group: 'com.google.common.annotations'

Dies ist das build.gradle Vor alle Versuche, den Fehler zu beheben:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // Google
    compile 'com.google.dagger:dagger:2.0'
    apt 'com.google.dagger:dagger-compiler:2.0'
    compile 'com.google.android.gms:play-services-identity:8.1.0'
    compile 'com.google.android.gms:play-services-plus:8.1.0'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.guava:guava:18.0'
    compile 'com.google.maps.android:android-maps-utils:0.4'
    compile('com.google.apis:google-api-services-calendar:v3-rev125-1.20.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }

    // Android Design
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:palette-v7:23.0.1'

    // Android Support
    compile('com.android.support:appcompat-v7:22.2.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    compile('com.android.support:support-v4:22.2.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }

    // Firebase
    compile('com.firebase:firebase-client-android:2.3.1') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    compile('com.firebase:firebase-client-jvm:2.3.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }

    // Joda Time
    compile 'net.danlew:android.joda:2.8.0'
    compile 'org.joda:joda-convert:1.2'

    // Square
    compile 'com.squareup:otto:1.3.5'
    compile 'com.jakewharton:butterknife:7.0.1'
    provided 'javax.annotation:jsr250-api:1.0'

    // Common
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'org.apache.commons:commons-collections4:4.0'

    compile 'com.bignerdranch.android:expandablerecyclerview:1.0.3'
}

Ich habe mein Projekt gesucht Beta.class und stellte fest, dass es nur in einigen Gläsern verwendet wird; com.google.common.annotations, com.google.api.client.util und dagger.internal. Ich habe versucht, das hinzuzufügen exclude group zu diesen verwandten Abhängigkeiten und sehen immer noch den gleichen Fehler.

Ich stecke schon viel zu lange hier fest. Irgendwelche Vorschläge?

  • Ich hatte dieses Problem gerade beim Aktualisieren des Android Gradle-Plugins auf com.android.tools.build:gradle:1.4.0-beta3. In meinem Fall liegt das Problem an AndroidSlidingUpPanelLayout, das wiederum von nineoldandroids abhängt (Verknüpfung) und erzeugt den Fehler. Ich “reparierte” es zurück zu com.android.tools.build:gradle:1.3.0.

    – Roi

    1. Okt ’15 um 9:33

  • Ich bin immer noch auf 1.3.0 und habe mich seit dem Erscheinen nicht geändert.

    – Chad Bingham

    3. Okt ’15 um 17:38

  • @ChadBingham Können Sie versuchen, auch auszuschließen? com.google.guava:guava-jdk5:13.0 Modul; Und dann die Aufgabe erneut ausführen?

    – kucing_terbang

    7. Okt. 15 um 7:38 Uhr

  • @kucing_terbang erweitern, Guave von welchem ​​Modul ausschließen? oder was von Guave ausschließen?

    – Chad Bingham

    7. Okt ’15 um 18:44

  • @ChadBingham aus google-api-services-calendar Modul.

    – kucing_terbang

    8. Oktober ’15 um 4:34

Ausschließen group: 'com.google.guava' von spieldienstbezogenen Abhängigkeiten.

Beispielsweise:

compile ('com.google.android.gms:play-services:8.1.0'){
    exclude group: 'com.google.guava'
}

PS Bevor ich Ihren Fehler bekomme, habe ich mich mit vielen verschiedenen konfrontiert, daher ist meine endgültige Liste der Abhängigkeiten:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // Google
    compile 'com.google.dagger:dagger:2.0'
    apt 'com.google.dagger:dagger-compiler:2.0'
    compile ('com.google.android.gms:play-services-identity:8.1.0'){
        exclude group: 'com.google.guava'
    }
    compile ('com.google.android.gms:play-services-plus:8.1.0'){
        exclude group: 'com.google.guava'
    }
    compile ('com.google.android.gms:play-services:8.1.0'){
        exclude group: 'com.google.guava'
    }
    compile 'com.google.guava:guava:18.0'
    compile 'com.google.maps.android:android-maps-utils:0.4'

    compile('com.google.apis:google-api-services-calendar:v3-rev125-1.20.0') {
        exclude group: 'org.apache.httpcomponents'
        exclude group: 'com.android.support'
        exclude module: 'support-annotations'
        exclude group: 'com.google.guava'
    }

    // Android Design
    compile ('com.android.support:design:23.0.1'){
        exclude group: 'com.android.support'
    }
    compile ('com.android.support:recyclerview-v7:23.0.1') {
        exclude group: 'com.android.support'
    }

    compile 'com.android.support:cardview-v7:23.0.1'
    compile ('com.android.support:palette-v7:23.0.1'){
        exclude group: 'com.android.support'
    }

    // Android Support
    compile('com.android.support:appcompat-v7:22.2.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
        exclude group: 'com.android.support'
    }

    compile 'com.android.support:support-annotations:23.0.1'
    compile('com.android.support:support-v4:22.2.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
        exclude module: 'support-annotations'
    }

    // Firebase
    compile('com.firebase:firebase-client-android:2.3.1') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    compile('com.firebase:firebase-client-jvm:2.3.0') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }

    // Joda Time
    compile 'net.danlew:android.joda:2.8.0'
    compile 'org.joda:joda-convert:1.2'

    // Square
    compile 'com.squareup:otto:1.3.5'
    compile 'com.jakewharton:butterknife:7.0.1'
    provided 'javax.annotation:jsr250-api:1.0'

    // Common
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'org.apache.commons:commons-collections4:4.0'

    compile ('com.bignerdranch.android:expandablerecyclerview:1.0.3'){
        exclude group: 'com.android.support'
    }
}

  • Warum war Guave speziell diejenige, die ausgeschlossen werden musste?

    – Igor Ganapolsky

    21. Juli ’16 um 17:04

  • @IgorGanapolsky, ich habe versucht, Guave intuitiv auszuschließen. Und Guave war wirklich ein Problem. Ich habe keine Ahnung warum…

    – Oleksandr

    22. Juli ’16 um 13:14

  • Ich habe das gleiche Problem. Ich habe dieselbe Bibliothek verwendet in libs Ordner sowie in Gradle-Abhängigkeit. Ich habe an einer Stelle entfernt und das Problem ist weg.

    – Akbarsha

    20. September ’16 um 16:11

  • Ich fand es einfacher, meinen Verweis auf Guave zu entfernen //com.google.guava:guava:20.0 kompilieren.

    – Marc

    3. Januar ’17 um 5:10


  • Ich habe “doppelten Eintrag: com/google/api/client/util/ArrayMap$Entry.class” erhalten.

    – Iman Marashi

    21. Januar ’17 um 17:51

Ich habe diesen Fehler erhalten, als ich in meinem App-Modul und einem Bibliotheksmodul verschiedene Versionen von Play-Services-Bibliotheken hatte.

  • Toll! Nur diese Antwort hat mein Problem gelöst, danke für die Erwähnung!

    – Arshad Ali

    29. Juli ’16 um 3:54

Ich habe den Grund für die falsch konfigurierte gefunden dagger-compiler:

compile 'com.google.dagger:dagger-compiler:2.1'

Was ich getan hatte, war, das Projekt build.gradle zu ändern:

buildscript {
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
}

Und später die Anwendung build.gradle:

Fügen Sie zuerst das Plugin hinzu:

apply plugin: 'com.neenbedankt.android-apt'

Ändern Sie die Abhängigkeit später wie folgt:

apt "com.google.dagger:dagger-compiler:2.1"

  • Ich hatte das gleiche Problem, hatte einen Eintrag: apt ‘com.google.dagger:dagger-compiler:2.1’ und dann einen anderen: kompilieren ‘com.google.dagger:dagger-compiler:2.1’ kompilieren Eintrag hat die TransformException für mich gelöst.

    – brAzzi64

    4. Juni ’16 um 21:10


.

206610cookie-checkTransformException doppelter Eintrag für common.annotations.Beta

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy