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.
I ran into this when I upgraded from adt 14 to 15 and to get it to work I ended up just deleting the .eclipse folder (along with my settings) and re-installing the adt 15.
Solution for me:
Navigate to your project workspace (not your project) and run the following commands:
dev1:workspace$ cd ~/Documents/workspace/.metadata/.plugins/ dev1:workspace$ rm -rf org.eclipse.core.resources
Navigate to your Eclipse directory and type this command:
dev1:eclipse$ ./eclipse clear
Eclipse will start with an empty workspace - don't worry your projects are still there. Simple create new project from existing resource and things should be gravy.
The exact error I was receiving: [2012-02-07 14:15:53 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter; [2012-02-07 14:15:53 - ProjectCloud] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter;
None of the above helped. It was a simple problem in the end.
I had a project which uses the FacebookSDK and ViewPagerIndicator as library projects. All were built on Android API 16 and those two projects used the android support library vX (X not being 16!)
I added an external JAR to both those projects and pointed it to \extras\android\v4... And also removed the v4 jar I had in their libs folders.
Clean all projects and re-build.
Voilla!
The exact error I was receiving: Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter; Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter;
For me, I just right click on project -> Build path -> configure build path -> Libraries -> remove dependency
after it works.
I was basically facing the same issue. I deleted the BIN folder, then removed unused jar files for Order and Import from eclipse. IT WORKED after that
This error can happen if you have two jars that contains the same class names, e.g. I had two library: jsr311-api-1.1.1.jar, and jersey-core-1.17.1.jar, both containing the class javax.ws.rs.ApplicationPath. I removed jsr311-api-1.1.1.jar and it worked fine.