Unable to execute dex: Multiple dex files define
Conversion to Dalvik format failed with error 1
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/cyberwalkabout/common/DistanceUtils;
We have been using multiple project libraries for months, but now including them causes a problem as some of them are referenced more than once.
I found suggestions, however they don't apply to my particular problem as the error is caused by my own library projects
- remove external jars from build-path and re-add them as the local jar instead
- remove all external jars and re-added them one at a time making sure they were the right ones
- removed the .classpath file, bin and gen directories
- clean the project in Eclipse, forcing the files to be regenerated
- shuffled around the jar files in the build order
uki: /Applications/IDE/eclipse $ ./eclipse clean
Updates (Android ADT 14) in Eclipse Indigo that introduced these problems:
switch() to if-then
Among many, many things that went wrong today this one was was annoying because of many places I had to change, but at least quick to fix.
Android ADT 14 decided that it does not like to use R.id.reference as a parameter to switch statement and it had to me changed to if-then.
So all of the switch statements had to be converted to if-then. Thankfully there is a shortcut for that (command-1).



How did you resolve the error "Unable to execute dex: Multiple dex files define"
ReplyDeletethis error accounts when you reference a library more than once. Simple go to build path of the project and you can see,just remove one reference and here you go.
ReplyDelete