Android build apk:重复条目

时间:2017-07-04 21:00:48

标签: android duplicates

在尝试编译我的代码时,我得到了:

  

错误:任务执行失败':android:transformClassesWithJarMergingForDebug'。

     

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / internal / zzjm.class

似乎错误发生在build.gradle文件中。这是root build.gradle:

// Ed's note: apparent missing line here from original post
    dependencies {
       classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
       classpath 'com.android.tools.build:gradle:2.3.2'
       classpath 'com.google.gms:google-services:3.0.0'
    }
}

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

    configurations { natives }

    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"
    }
}

project(":core") {
    apply plugin: "java"

    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
    }
}

tasks.eclipse.doLast {
    delete ".project"
}

并且android build.gradle包含:

dependencies {
    compile project(':baseGameUtils')
    //compile files('libs/libGoogleAnalyticsServices.jar')
    compile files('libs/appbrain-applift-sdk-10.51.jar')
    compile 'com.google.android.gms:play-services-ads:9.0.0'
}
apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:0)

这似乎与google-services:3.0.0有关 当您使用com.google.gms:google-services:3.1.0时,问题应该得到解决。

我碰巧在AppBrain上工作,我注意到你的AppBrain SDK的gradle配置使用了一个非常过时的版本(10.51,而当前版本是13.22)。如果您在https://www.appbrain.com/info/help/sdk/gettingstarted.html我们的文档中指定添加gradle依赖项,您将始终使用最新版本。