0

我正在使用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工作室会有不同?

2
  • 里面是什么图书馆?
    – 亚里安
    评论 2017年8月30日19:11
  • tween-engine-api.jartween-engine-api-sources.jar在我的android/libs中,只有libgdx相关的东西。
    – 利贾斯
    评论 2017年8月30日19:21

1答案1

重置为默认值
0

这是由于工件不匹配/版本冲突造成的。

删除

编译“com.google.android.gms:play-services-games:11.2.0”

从root的android依赖项标签建筑梯度文件,基本游戏实用程序已经有了这种依赖。在中检查支持版本建筑梯度属于基本游戏实用程序模块。

此外,最好使用来自回购的工件,而不是来自图书馆文件夹。

你也可以在发动机之间喷射

存储库{maven{url“https://jitpack.io" }}编译“com.github.arcnor:universal-tweengine:6.3.4”编译“com.github.arcnor:universal-tweengine:6.3.4:sources”

你的答案

单击“发布您的答案”,表示您同意我们的服务条款并确认您已阅读我们的隐私政策.

不是你想要的答案吗?浏览标记的其他问题问你自己的问题.