2017-09-20 2 views
1

APKをビルドしようとしていますが、作成しようとするとエラーが発生します。AndroidスタジオAPKビルドエラーtransformClassesWithJarMergingForDebug

エラー: ':app:transformClassesWithJarMergingForDebug'タスクの実行に失敗しました。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/gcm/PendingCallback.class

私のbuild.gradleです(モジュール:アプリ)に続き

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "jordan.personicle" 
     minSdkVersion 19 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

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

    compile files('libs/ajt-2.9.jar', 'libs/javaml-0.1.7.jar') 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:26.+' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.android.gms:play-services:11.0.1' 
    compile 'com.google.firebase:firebase-database:10.2.1' 
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-messaging:10.0.1' 

    compile 'com.firebase:firebase-jobdispatcher:0.6.0' 

    compile 'org.jsoup:jsoup:1.7.3' 
    compile 'com.android.support:multidex:1.0.0' 

    testCompile 'junit:junit:4.12' 
} 

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

これは私がGCMには重複がないと思います私のbuild.gradle(プロジェクト)

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
     repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.google.gms:google-services:3.0.0' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

です。何が問題ですか?

おかげで、

+0

問題を参照してください「をcom.google.android.gmsをコンパイルします:プレイサービス:11.0.1 '。これをどのように解決すればよいですか?依存関係は上記と重複することができますか? –

答えて

0

すべてのあなたのGoogle Playのサービスのlibsで同じバージョンを使用していることを確認してください:

compile 'com.google.android.gms:play-services:11.0.4' 
compile 'com.google.firebase:firebase-database:11.0.4' 
compile 'com.google.firebase:firebase-core:11.0.4' 
compile 'com.google.firebase:firebase-messaging:11.0.4' 

https://stackoverflow.com/a/42610163/1370087

+1

ご返信ありがとうございます。私はバージョンを同期しようとしましたが、同じエラーです。コンパイル 'com.google.firebase:firebase-database:10.2.1' コンパイル 'com.google.firebase:firebase-core:10.2.1' コンパイル 'com.google.firebase:firebase-messaging:10.2.1' –

+0

私の更新された回答を参照してください、それは私のために働く – Benjamin

+1

ありがとうBenjamin。しかし、それでも同じエラーが表示されます。 –

関連する問題