我正在使用libgdx和Android工作室。我已经成功实现了谷歌游戏服务(排行榜等)。现在我想实现admob,但出现了错误。
这是我build.gradle的一部分:
项目(“:android”){应用插件:“android”配置{本机}依赖关系{编译项目(“:core”)编译“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”编译“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”编译“com.google.android.gms:play-services-games:11.2.0”编译“com.google.android.gms:play-services-ads:11.2.0”//编译“com.google.android.gms:play services:10.0.1'”compile fileTree(目录:“../libs”,包括:“*.jar”)编译项目(“:BaseGameUtils”)}
}
如果我按build->clean projects,一切似乎都很好,但当我想在我的安卓手机上运行应用程序时,我会得到以下错误:
错误:任务执行失败“:android:transformClassesWithJarMergingForRelease”。>com.android.build.api.转换。转换异常:网址:java.util.zip。ZipException:重复条目:com/google/android/gms/internal/zzqv.class
它是编译“com.google.android.gms:play-services-ads:11.2.0”
把事情搞砸的部分。如果我删除那一行,一切都会像以前一样,但我不能使用AdMob。
有人知道问题是什么吗?
当我使用Eclipse时,我将google-play-service库作为一个项目包含在内,不需要向build.gradle添加任何内容。。。为什么在Android工作室会有不同?