6

ein App Aufbau erzeugt die folgenden Fehler:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. 
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/appcompat/R$anim.class 

ich gereinigt und baute das Projekt viele Male ohne Erfolg . Es hat die folgenden in seiner Größe Build:

compile 'com.android.support:appcompat-v7:23.3.0' 

Es verwendet auch eine Bibliothek über seine aar-Datei. Dieses Bibliotheksprojekt hat auch das oben genannte in seiner Größe.

Kann jemand einen Tipp geben, wie man das löst?

+0

Entferne das Duplikat. So einfach ist das. Wenn Sie eine AAR-Datei haben, die bereits etwas für Sie zusammengestellt hat, müssen Sie sie nicht erneut kompilieren. –

+1

post your gradle –

+0

@ cricket_007 Wie kann das Duplikat entfernt werden? Ich habe versucht: Modul auszuschließen: 'appcompat-v7', aber es hat nicht geholfen. Meinst du nicht "kompilieren" com.android.support:appcompat-v7:23.3.0 '"? Die App benötigt appcompat-v7. Ohne sie würde es Fehler geben. – Hong

Antwort

4

Yup, Gesicht gleiche Problem vor wenigen Tagen

Reason - as you told "That library project also has the above in its gradle build" actually system wont able to understand which dependency hi will take (app's - compile 'com.android.support:appcompat-v7:23.3.0' or module project's - compile 'com.android.support:appcompat-v7:23.3.0') so that hi says you have duplicate entry

Wie Resolve -

Step 1 - Just Clean/Build Project. go to Build -> Clean/Build Project.

Step 2 - In terminal execute in root project folder ./gradlew clean*

Step 3- you have to exclude your group from one dependency

compile('com.android.support:design:23.2.1') { 
    exclude group: 'com.android.support', module: 'support-v7' 
} 

Step 4 - Check Out This Awsome Answer https://stackoverflow.com/a/19022328/4741746

Und für mich, dass die Arbeit Antwort ist -

Ich recht t entferne 1 Abhängigkeit von apps level gradle und lege nur module project level gradle fest und schließe auch support-v4 aus, in dem diese anim class existiert

compile 'com.android.support:appcompat-v7:23.2.1' 
     compile('com.android.support:design:23.2.1') { 
      exclude group: 'com.android.support', module: 'support-v4' 
     } 
Verwandte Themen