2017-09-13 2 views
0

이런 문제가 있다는 것을 알고 있지만 도움이되는 답변을 찾지 못했습니다. 따라서 Gradle Console에서 다음 오류를보고합니다.com.android.build.api.transform.TransformException : java.util.zip.ZipException gradle 빌드가 실패했습니다

* 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' 
관련 문제