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.
You have probably installed r14, this error may have been caused due to the platform tools update, you have to re-install your sdk
Go to Project/properties and Java Build Path and unchecked the Android Private Libraries.
Done
I have several library projects with the same package name specified in the AndroidManifest (so no duplicate field names are generated by R.java). I had to remove any permissions and activities from the AndroidManifest.xml for all library projects to remove the error so Manifest.java wasn't created multiple times. Hopefully this can help someone.
Modify your eclipse.ini file and set the maximum memory parameter to
Then restart your computer.
It worked for me.
I converted a non-library project to a library project, but it had a previously built jar file in the libs folder. Removing this jar file caused this error to go away.
As others have mentioned, this occurs when you have multiple copies of the same class in your build path - including bin/ in your classpath is one way to guarantee this problem.
For me, this occurred when I had added android-support-v4.jar to my libs/ folder, and somehow eclipse added a second copy to bin/classes/android-support-v4.jar.
Deleting the extra copy in bin/classes solved the problem - unsure why Eclipse made a copy there.
You can test for this with