Multiple dex files define Lcom / amazon / ags / BuildConfig when using GameCircleSDK in Android Studio

I recently imported my Android project from Eclipse to AndroidStudio. Everything went pretty well, and I was able to solve most of the issues, except when he got 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; 

As it turned out, com.amazon.ags.BuildConfig.class was really contained in two banks: classes.jar (which received generated during assembly) and GameCircleSDK / libs / gamecirclesdk.jar .

The only way to solve the problem is to unzip the gamecirclesdk.jar file, delete the BuildConfig.class and fix it back again. I was looking for interns to solve, and I tried almost everything listed here , but nothing seemed to solve my situation. Did I miss something?

+6
source share
2 answers

The problem is that GameCricleSDK.jar contains a BuildConfig file with the package name "com.amazon.ags", and the whole module also generates a BuildConfig file with the same package name as in the manifest. I changed the package name in the module manifest file and the problem disappeared.

SOLUTION: Take the GameCircleSDK library, open its AndroidManifest.xml and change the package name from "com.amazon.ags" to another, no matter what. I changed it to "com.amazon.ags.lib".

+16
source

I ran into the same problem using another library project (WeiboSDK). You may also need to change the applicationId file in the library's build.gradle file to the same value in the AndroidManifest.xml library.

0
source

All Articles