2017-09-13 14 views
0

私はこのような問題があることを知っていますが、役に立たない回答はありません。だからGradle Consoleはこのエラーを報告します:com.android.build.api.transform.TransformException:java.util.zip.ZipException gradle build failed

* What went wrong: 
Execution failed for task ':android:transformClassesWithJarMergingForDebug'. 
> com.android.build.api.transform.TransformException: 
java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzbvq.class 

私は重複した依存関係を見つけることができません。あなたがプレイライブラリの同じバージョンを使用する必要が

project(":android") { 
apply plugin: "android" 

configurations { natives } 

dependencies { 
    compile project(":core") 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.google.android.gms:play-services-ads:11.2.0' 
    compile 'com.google.android.gms:play-services-games:11.2.2' 
    compile 'com.android.support:support-annotations:24.2.0' 
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 
    compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64" 
    compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64" 


} 

}

+0

':core'の依存関係は何ですか? 'libs /'にはどんなJARがありますか? – CommonsWare

+0

'gradlew android:dependencies'を実行し、出力から' releaseCompileClasspath'セクションを投稿してください – DeKaNszn

答えて

1

変更あなたののGradleで以下の行:

compile 'com.google.android.gms:play-services-ads:11.2.0' 
compile 'com.google.android.gms:play-services-games:11.2.2' 

へ:

compile 'com.google.android.gms:play-services-ads:11.2.2' 
compile 'com.google.android.gms:play-services-games:11.2.2' 

その後、清潔で、プロジェクトを再構築します。

希望します。

1

再生ライブラリのバージョンを変更するだけです。依存関係で同じバージョンのライブラリを使用する必要があるので、以下のようにします。

compile 'com.google.android.gms:play-services-ads:11.2.2' 
compile 'com.google.android.gms:play-services-games:11.2.2' 
関連する問題