Skip to content Skip to sidebar Skip to footer

Unable To Execute Dex: Multiple Dex Files Define Lorg/simpleframework/xml/attribute

I am implementing C2Call library for dial call purpose in one application, and C2Call library has lots of jar files, simple-xml-2.6.7.jar is part of C2Call library. simple-xml-2.6.

Solution 1:

This problem happens if you are importing the same library in two different jars. You need to carefully check all the jars and try to find out the jars which are importing the same libraries. If you have the source code then you can easily build the jar again without adding the library.

Another thing to try is to break it into multiple dex files. Please read from here

http://android-developers.blogspot.co.il/2011/07/custom-class-loading-in-dalvik.html

"Big apps can contain more than 64K method references, which is the maximum number of supported in a dex file. To get around this limitation, developers can partition part of the program into multiple secondary dex files, and load them at runtime."

I think you have more than 64k method references and that is causing the problem. Let me know if it works for you

Solution 2:

It happens when you try to export same jar file twice in single .apk file. Simple way to eliminate this error

Check your:- Android private libraries Referenced Libraries Android Dependencies

and make sure that no jar file is repeated.If any jar file is repeated then find it in libs folder of your project and delete it and then refresh the project.

If this does not solve then try:-

Right Click Project>Properties>Java Build path>Order and Export> uncheck android private Libraries.

Solution 3:

I added MobFox simple-xml-2.7.1.jar file to Android lib file. When i generated apk i have this error. Delete simple-xml-2.7.1.jar after regenerate apk. I solved my problem by this way.

Post a Comment for "Unable To Execute Dex: Multiple Dex Files Define Lorg/simpleframework/xml/attribute"