Reputation: 315
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.7.jar is giving me an error in my application at compile time:
[2014-08-21 11:09:56 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/simpleframework/xml/Attribute;
[2014-08-21 11:09:56 ] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/simpleframework/xml/Attribute;
I've done a lot of surfing to solve this problem, but I can not find solution to resolve this problem.
I hope, you can give solution for this problem.
Thanks.
Upvotes: 2
Views: 936
Reputation: 2299
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.
Upvotes: 0
Reputation: 1289
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
Upvotes: 1
Reputation: 507
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.
Upvotes: 1