2017-04-18 3 views
-3

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzbtk.classFehler: Ausführung fehlgeschlagen für Task: app: transformClassesWithJarMergingForDebug

Wenn ich unser Android Studio-Projekt ausführen, treten diese Fehler auf. Wie könnte ich sie lösen?

Meine gradle Datei:

apply plugin: 'com.android.application' 


android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.shikshamela.shikshamela" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     multiDexEnabled true 

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

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 


    }) 


    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.android.gms:play-services-auth:10.2.1' 
    compile 'com.google.firebase:firebase-messaging:10.2.1' 
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-auth:10.0.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    testCompile 'junit:junit:4.12' 
} 

apply plugin: 'com.google.gms.google-services' 
+0

zu alt Frage .show Ihre 'build.gradle' –

+0

Ihre' kompilieren ‚com.google.firebase entfernen: Feuerbasis-Messaging: 10.2.1'' Linie und versuchen complier –

Antwort

0

anwenden Plugin: 'com.android.application'

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.shikshamela.shikshamela" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     multiDexEnabled true 

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

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 


    }) 




     compile 'com.android.support:multidex:1.0.1' 
     compile 'com.android.support:appcompat-v7:25.3.1' 
     compile 'com.android.support:design:25.3.1' 
     compile 'com.android.support.constraint:constraint-layout:1.0.2' 
     compile 'com.google.android.gms:play-services-auth:10.2.1' 
     compile 'com.google.firebase:firebase-messaging:10.2.1' 
     compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-auth:10.0.1' 
    compile 'com.android.support:support-v4:25.3.1'    
    testCompile 'junit:junit:4.12' 

} 
apply plugin: 'com.google.gms.google-services' 
+0

unter/libs Verzeichnis haben Sie einige .jar-Dateien wie support-v4? –

+0

Verwenden Sie '10.2.1' anstelle von' 10.0.1'. –

+0

Diesen Beitrag entfernen und diesen Frageabschnitt hinzufügen –

0
// copy paste below code 

dependencies { 
     compile fileTree(include: ['*.jar'], dir: 'libs') 
     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
      exclude group: 'com.android.support', module: 'support-annotations' 


     }) 


     compile 'com.android.support:multidex:1.0.1' 
     compile 'com.android.support:appcompat-v7:25.3.1' 
     compile 'com.android.support:design:25.3.1' 
     compile 'com.android.support.constraint:constraint-layout:1.0.1' 
     compile 'com.google.android.gms:play-services-auth:10.2.1' 
     compile 'com.google.firebase:firebase-messaging:10.2.1' 
     compile 'com.google.firebase:firebase-core:10.2.1' 
     compile 'com.google.firebase:firebase-auth:10.2.1' 
     compile 'com.android.support:support-v4:25.3.1' 
     testCompile 'junit:junit:4.12' 
    } 
+0

Wenn diese Fehler geändert werden, wird –

+0

angezeigt Fehler: Beim Konfigurieren des Projekts ': app' ist ein Problem aufgetreten. > Konnte nicht alle Abhängigkeiten für die Konfiguration auflösen > com.android.support.constraint konnte nicht gefunden werden: constraint-layout: 25.3.1. > com.google.android.gms konnte nicht gefunden werden: play-services-auth: 25.3.1. > com.google.firebase konnte nicht gefunden werden: firebase-messaging: 25.3.1. Erforderlich von: Projekt: App > Konnte com.google.firebase nicht finden: firebase-core: 25.3.1. > com.google.firebase konnte nicht gefunden werden: Firebase-Auth: 25.3.1. Benötigt von: Projekt: app –

+0

Hallo, ich habe meine Antwort aktualisiert bitte überprüfen. – vinod

0

versuchen diese Änderung

compile 'com.android.support:multidex:1.0.1' 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support:design:25.3.1' 
compile 'com.android.support.constraint:constraint-layout:25.3.1' 
compile 'com.google.android.gms:play-services-auth:25.3.1' 
compile 'com.google.firebase:firebase-messaging:25.3.1' 
compile 'com.google.firebase:firebase-core:25.3.1' 
compile 'com.google.firebase:firebase-auth:25.3.1' 
compile 'com.android.support:support-v4:25.3.1' 
testCompile 'junit:junit:4.12' 

Um

012.351.
compile 'com.android.support:multidex:1.0.1' 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support:design:25.3.1' 
compile 'com.android.support.constraint:constraint-layout:25.3.1' 
compile 'com.google.android.gms:play-services-auth:25.3.1' 
compile 'com.google.firebase:firebase-messaging:10.2.1' 
compile 'com.google.firebase:firebase-core:10.2.1' 
compile 'com.google.firebase:firebase-auth:10.2.1' 
compile 'com.android.support:support-v4:25.3.1' 
testCompile 'junit:junit:4.12' 
0

Machen Sie abhängige Gläser kompatibel, so aktualisieren Sie diese beiden neuesten Version.

compile 'com.google.firebase:firebase-core:10.0.1' 
compile 'com.google.firebase:firebase-auth:10.0.1' 

Update

compile 'com.google.firebase:firebase-core:10.2.1' 
compile 'com.google.firebase:firebase-auth:10.2.1' 
Verwandte Themen