android - 任务 ':android:transformClassesWithJarMergingForRelease'的执行失败

标签 android gradle libgdx android-gradle-plugin build.gradle

我无法解决以下错误

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

我确实知道问题在于版本冲突,但是我不知道如何解决这个问题。

我的android依赖项是:
 dependencies {
        compile project(":core")
        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.google.android.gms:play-services-ads:10.0.0'

        compile 'com.google.android.gms:play-services-games:10.0.0'
        compile project(':BaseGameUtils')



    }

我应该如何解决?

最佳答案

我必须仔细结合以前类似的问题类型才能得到答案,我必须在build.gradle的配置块中添加以下行

 all*.exclude group: 'com.google.android.gms', module: 'play-services-plus' 

关于android - 任务 ':android:transformClassesWithJarMergingForRelease'的执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41176615/

相关文章:

gradle - 如何使用 gradle 将 .properties 文件添加到我的 WAR 中?

java - 如何在 LibGDX 中使用 ShapeRenderer 和 ScrollPane?

android - 创建 Stack Overflow 通知器

android - 使用数字验证用户

gradle - 创建一个依赖于另一个(外部)插件的Gradle插件

gradle - 将平台约束应用于所有配置

java - 删除失败时 Actor 会迷路 -libgdx

java - 在 "dispose()"内的 Music 对象上使用 "OnCompletionListener()"?

android.app.Fragment$InstantiationException : Trying to instantiate a class ScannerFragment that is not a Fragment

android - GPS 硬件要求和自定义下载链接