我正在尝试在我的应用中使用 google play 服务。
我在我的应用程序和 BaseGameUtils 中都引用了库,google play 服务,我无法执行 dex:多个 dex 文件定义 Lcom/google/android/gms/ads/AdActivity; "
通常这意味着您有两个具有相同类名的 .jar 文件。我唯一的问题是我不知道哪些 jar 文件具有相同的类。另外,我的 libs 文件夹中没有 google-play-services 作为 jar,也没有在构建路径菜单中将其作为外部 jar 添加。所以我只有两个依赖项 google-play-servies 和 BaseGameUtils,它也使用 google-play-servies 作为库。那么有人能告诉我这个问题到底意味着什么吗,因为我已经尝试了一切......
这是我的研究,表明我曾尝试帮助自己..
Can´t use adMob api since I updated to API 19
"Conversion to Dalvik format failed with error 1" on external JAR
adMob.jar library and google play service.jar not working together
最佳答案
So all i have are two dependencies google-play-servies, and BaseGameUtils, which also uses google-play-servies as a library
您是说您在 BaseGameUtils 和您的项目中都引用了 Google Play 服务?
在 BaseGameUtils 中引用 Google Play 服务。
在您的项目中引用 BaseGameUtils。
然后检查以确保您的广告设置正确(admobs 现在在 google play 服务中,不再是一个单独的 jar):
Multiple dex files define - Deleting extra jar file still not working. What should I do?
关于java - 无法执行 dex : Multiple dex files define Lcom/google/android/gms/ads/AdActivity;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24718671/