多DEX文件的Andr​​oid Studio中使用GameCircleSDK时定义LCOM /亚马逊/ AGS / BuildConfig [英] Multiple dex files define Lcom/amazon/ags/BuildConfig when using GameCircleSDK in Android Studio

查看:290
本文介绍了多DEX文件的Andr​​oid Studio中使用GameCircleSDK时定义LCOM /亚马逊/ AGS / BuildConfig的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近进口我的Andr​​oid项目从Eclipse转换AndroidStudio。一切都相当好,我是能够解决大部分问题,除非它下来到GameCircleSDK库模块。我一直得到以下错误:

I recently imported my Android project from Eclipse into AndroidStudio. Everything went fairly well, and I was able to resolve most issues, except when it came down to the GameCircleSDK library module. I kept getting the following error:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/amazon/ags/BuildConfig;

事实证明,在 com.amazon.ags.BuildConfig.class 确实包含在两个罐子: classes.jar (它得到了编译过程中产生的)和 GameCircleSDK /库/ gamecirclesdk.jar

As it turns out, the com.amazon.ags.BuildConfig.class was indeed contained in two jars: classes.jar (which got generated during the build) and GameCircleSDK/libs/gamecirclesdk.jar.

我能解决这个问题的唯一办法是解压缩的 gamecirclesdk.jar 的,删除 BuildConfig.class ,并压缩回来了再次。我搜索了一个解决方案的互联网络,我试图只是上市的一切<一个href=\"http://stackoverflow.com/questions/7870265/unable-to-execute-dex-multiple-dex-files-define-lcom-myapp-rarray\">here,但似乎没有任何解决我的处境。我缺少的东西吗?

The only way I could solve the issue was to unzip the gamecirclesdk.jar, remove the BuildConfig.class, and zip it back up again. I searched the internets for a solution, and I tried just about everything listed here, but nothing seemed to resolve my situation. Am I missing something?

推荐答案

的问题是,GameCricleSDK.jar包含BuildConfig与包名com.amazon.ags文件,整​​个模块也产生BuildConfig具有相同的封装文件名称作为舱单申报。我改变了模块清单文件和解决问题的包名就走开了。

The problem is that GameCricleSDK.jar contains BuildConfig file with package name "com.amazon.ags" and the whole module is also generating BuildConfig file with the same package name as declared in Manifest. I changed the package name in module Manifest file and problem went away.

解决方案:
就拿GameCircleSDK库,打开它的Andr​​oidManifest.xml和com.amazon.ags改变的packageName某事物别的不管。我把它改成com.amazon.ags.lib。

SOLUTION: Take the GameCircleSDK library, open it's AndroidManifest.xml and change the packageName from "com.amazon.ags" to sth else no matter what. I changed it to "com.amazon.ags.lib".

这篇关于多DEX文件的Andr​​oid Studio中使用GameCircleSDK时定义LCOM /亚马逊/ AGS / BuildConfig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆