Since updating to ADT
14 I can no longer build my project. It was building fine prior to updating.
The error:
[2011-10-23 16:23:29 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;
[2011-10-23 16:23:29 - myProj] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;
Similar issues have been reported and I have tried the suggestions there including
- Restarting
Eclipse
. - Cleaning the project and rebuild - Disable "Project->Build Automatically" option, then "Clean" and "Build" project, then try to run. reset "Build Automatically" option to On
- Re-installing the
Android
Developer Tools - Re-installing Eclipse (updated to the latest version 3.7.1)
- Created a new project importing from the file system
- Created a new project from subversion.
After reading Terrys response about deleting the bin directory and Larrys about the the location of the ANT directory:
I moved the files located in my projects BIN directory to the BIN/CLASSES and im up and running.
Edit 1 Then failed on second run...doh
Edit 2 So closed Eclipse moved files back to original location and its all working... um what? I don't pretend to know why this worked. Will update if any changes.
Edit 3 I have noted from my backups that there were indeed duplicate files in the BIN directory and BIN/CLASSES.
So the answer is: don't have files in both locations. At least for me that's what worked.
Select the project in Project Explorer, right-click and select Properties -> Java Build Path -> Source -> Check the box for Allow output folders for source folders
I removed Android dependencies from build path and it worked.
Edit: ignore that. I had same jar in my maven dependencies and libs folder. I removed the one at the lib folder.
[Solved for me]
by removing the duplicate library "JAR file" then remove BuildConfig.java file, Clean project and its work.
I had the same problem, quite weird because it was happening only when using Eclipse (but it was OK with Ant). This is how I fixed it:
Project Name
Build Path
->Configure Build Path
In
Java Build Path
, go to the tabOrder and Export
Uncheck your
.jar
libraryOnly sometimes: In Order and Export tab I did not have any jar library there, so I have unchecked Android Private Libraries item. Now my project is running.
For me this problem only exists as long as there are Android library projects involved in my project. So when I remove all the libraries and do as you said I can run my app again. If there are libraries involved even the bin-removal-trick trick won' work.
I don't get why this bug first appeared today since I'm using ADT 14 for several days now. Well there were other bugs that kept me happy though.