my problem was resolved after cleaning up some directories and files left over from the previous versions of the tools. adt rev 14 changes where binaries are stored. i deleted the entire bin directory, restarted eclipse and cleaned the build and forced a rebuild. that seemed to do the trick initially but the problem came back after the next run.
i finally discovered that my bin directory was included in the project build path. i excluded bin from the build path and repeated the steps above. this resolved my problem.
i had two related but not identical guava libraries in the /libs directory, after i removed one, the problem went away.
for me i had pointed to a jar file in my builtpath which wasn't actually in that path anymore!
i got the same error message with the googleplayservice library project google-play-services.jar .
we use maven, for this reason i have to add the library in my local maven repository.(mvn install:install-file -dfile=xxx)
now the library is twice in the "java build path" -> libraries.
- once in android dependencies
- and once in the maven dependencies.
to fix the problem i need to remove the library from the google-play-services_lib/libs directory (the jar it is used automatically)
i had this problem and solved it by changing the path of the. jar for change directory, but the. jar pulled the other side, change the path and i entered without problem
i had the same problem unable to execute multipledex files in android --lorg\xhtml\css
i deleted 2external jars files in lib folder--core-renderer-3043e0f89ffb2.jar
core-renderer-minimal-e70d6a.jar and my project built fine again...
in my case, i delete the ".apk" file in the "src/com/..." directory, clean the project and run.
i had tried all the previous suggestions and did not work for me!
conversion to dalvik format failed: unable to execute dex: multiple dex files define lcom/google/zxing/barcodeformat;
posting this answer for those receiving this error with regards to the barcode scanner plugin from zxing.
just delete the jar file in the libs folder. should be project/libs/com.google.zxing.client.android.captureactivity.jar
this error occurred to me when i imported a .jar file (as a matter of fact it was httpmime-4.3.jar) and tried to use it. for me the solution was easy: i removed the .jar file from the libs folder and deleted it from order and export. ran the project again, it worked, so i added the .jar file again and it was finally okay.
the issue is that "android dependencies" keep the reference to the old admob sdk even after:
- remove the old admob sdk from build path
- ant clean
- eclipse clean
- delete the bin and gen folders manually
- close / open eclipse
- update sdk tools
- update adt
the solution is to actually delete the admob sdk jar from your computer, not just from the project.
check that your bin folder is not in the build path.
\bin\dexedlibs and remove all the jars of the already removed libraries, then clean
spliting google play service could help you : https://developers.google.com/android/guides/setup#split
so instead of adding just play-services :
you add only what you need :
// google maps only
if you use 'com.google.android.gms:play-services' you can add what you really need to look at the following list:
google account login
google actions, base client library
google address api
firebase app indexing
google cloud messaging
google location and activity recognition
google mobile ads
google panorama viewer
google play game services
delete generated r package from your referenced library. sometimes clean and rebuild doesn't remove old r generated files.
i resolved this issue in my project by deleting a library:
reason: i included a library-project in my project, and mistakenly did not removed the previous lib from my project, so when i was running the project then same library dex files were generating twice, when i removed the same-library from lib folder of my project, the error gone away and build was created successfully, i hope others may face the same issue.
non of the above methode worked for me but mine is worked like a charm!
the problem happens when user builds the dependent library with eclipse. so to get the solution
step 1: delete the library (like support library project v4 or v13) from eclipse with delete workspace source permanantly
step 2: re import the library and include it to your project
step 3: clean and rebuild
found another scenario where this issue happens: the problem was that the libs folder was used as a source in the project preferences, so it was exported twice. resolved by right clicking on the libs folder -> build path -> remove from build path
this happen when in our app, we have libs folder with
gson jar (eg: gson-2.2.4.jar).
in sametime, our google play service library already have
gson as well.
i have remove it from my app and
its work fine now.
this was the top result when i searched for this error in google.
though the question doesn't ask how to solve this issue in regards to react native, i thought i would share anyway for anyone who ends up here and is using react native.
from the project root run:
cd android && ./gradlew clean[mac - bash terminal]
cd android & gradlew clean[windows - command prompt]
react-native run-android to build and run again.
try deleting r.java and letting eclipse re-generate it.
i had a similar problem when i added actionbarsherlock as a library in my project. eclipse adt v21.0 pre-created dex files supposedly for faster building of the project. these dex files were the same as some of the jar files in my lib folder. so just keep one and delete the other. i deleted the ones in the lib folder as the dexed files were generating automatically.
i am facing the same problem. the problem i found that i have a library project, in that project's manifest file, there is no targetsdkversion property. i have added that property under (uses-sdk) tag. then clean my project. now my app runs normally.
make sure that "android-support-v4.jar" is unchecked in order and export tab under java build path
follow the steps:
- project properties
- java build path
- order and export
- uncheck "android-support-v4.jar"
i had tried most of the above solution and in past some of them had worked.
but this time none of them worked, so i had deleted my library project's .jar file. and rebuild both library and application project.
and this time it's worked!
after trying all the other suggestions with no luck, i deleted all the contents of my projects 'bin' directory, then ran eclipse again and it worked.
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.
i was facing the same issue then i saw while pushing my app some jar files which were loaded twice hence multiple dex error .just go to your project properties -> java build path and try unchecking jar which is being loaded twice.
[solved for me]
by removing the duplicate library "jar file" then remove buildconfig.java file, clean project and its work.
the adt r14 update changes where the classes go to the bin/classes directory (see http://tools.android.com/recent/buildchangesinrevision14). if you are using ant, you should change the path for your classes from bin to bin/classes. this worked for me.
solution for me:
- back up your code!
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;
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.
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.
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.
modify your eclipse.ini file and set the maximum memory parameter to
then restart your computer.
it worked for me.
found a solution i believe??
[2013-04-28 23:56:09 - dex loader] unable to execute dex: multiple dex files define lcom/coremedia/iso/abstractboxparser$1;
where it says : "lcom/coremedia/iso/abstractboxparser$1" that just happen to be the location of the library i imported that was causing the issue. looked for com.codemedia.iso.abstractboxparser$1.class and .abstractboxparser.class.... took that jar, unpackaged it, removed both of those files, then repackaged as a .zip, added to library, cleaned and worked! no more conflict for me! (also no updates or additional downloads)
i had two different versions of cordova .jar-files in my libs folder, i deleted the one i wasn't even using and it worked right away. weird because i didn't notice that before and it worked before and then suddenly stopped working...
i'm late to this party, but adding my own experience so i can find it again later :)
i ran into this problem after upgrading the android sdk and eclipse ad-ins. no upgrade goes unpunished!
the problem for me was related to library projects, my app references both standard java projects and android library projects. i noticed the java build path settings were including the android library projects src and res folders in the source list (upvotes to everyone that mention bin in source being issue, src and res was also an issue.)
so the solution was:
- remove all referenced android libraries source and project references from the java build path section of the settings in both source list and project list
- make sure pure java dependencies are listed in project list, and checked in the order and export tab so the classes are included in the apk
- make sure all android library dependencies are listed on the android section of project properties, in the library section below the checked sdk versions.
it was along way to piece all that together from the other solutions! phew!
deleting the bin folder was not enough, i also deleted the gen folder. then after two rebuilds the dex error message was gone.
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 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
you have probably installed r14, this error may have been caused due to the platform tools update, you have to re-install your sdk
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.
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.
go to project/properties and java build path and unchecked the android private libraries.
i was getting this error after adding the facebooksdk.jar to a project that already had dependencies on the android-support-v4.jar. since the facebooksdk.jar already includes its own android-support-v4.jar there were conflicts. removing the earlier android-support-v4.jar from the projects properties / java build path / libraries resolved the issue for me.
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.
for me, i just right click on project -> build path -> configure build path -> libraries -> remove dependency
after it works.
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
grep -r youroffendingclassname yourapp | grep jar
- close eclipse.
- delete bin folder inside your project folder.
- start eclipse and clean your project.
- now run and the problem should be gone
this problem was happening me, i had an external .jar in my libs folder called gson-2.2.2.jar but for some reason there were two of them, gson-2.2.2.jar and gson-2.2.2.jar(1), i simply deleted the latter and my project built fine again.
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.
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;
[solved for me]
eclipse project properties->java build path->order and export
uncheck android private libraries.
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:
- right click on the
configure build path
java build path, go to the tab
order and export
only 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.
- Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;
- Unable to execute dex: Multiple dex files define Lcom/google/android/gms/analytics/internal/Command
- Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr
- Eclipse, Android: Unexpected Unable to execute dex: Multiple dex files define
- Unable to execute dex: Multiple dex files define Lcom/.... yet again
- Unable to execute dex: Multiple dex files define Lorg/OpenUDID/OpenUDID_manager$ValueComparator;
- Unable to execute dex: Multiple dex files define Lorg/apache/commons/codec/binary/Base64;
- Eclipse: Unable to execute dex: Multiple dex files define Landroid/support/v4/
- Unable to execute dex: Multiple dex files define Lcom/facebook/AccessToken$1
- Eclipse/Java/Android Unable to execute dex: Multiple dex files define
- Unable to execute dex: Multiple dex files define
- Dex Loader] Unable to execute dex: Multiple dex files define Landroid/UnusedStub;
- Unable to execute dex: Multiple dex files define Ljavax/ws/rs/core/MultivaluedMap exception
- Unable to execute dex: Multiple dex files define
- Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files are defined
- Android Eclipse Unable to execute dex: Multiple dex files
- Unable to execute dex: Multiple dex files vs. E/AndroidRuntime( 1015): java.lang.NoClassDefFoundError
- UNEXPECTED TOP-LEVEL EXCEPTION: Multiple dex files define
- Multiple dex files define Landroid/support/v13/app/FragmentCompatICS
- Multiple dex files define Lorg/opencv/calib3d/Calib3d - opencv Android
- Multiple dex files define Lcom/nineoldandroids/animation/Animator$AnimatorListener
- Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
- Eclipse: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl
- Multiple dex files + Unable to start activity ComponentInfo
- Android application using Eclipse. classpath conflicts (Unable to execute dex: Multiple dex files define)
- dex loader unable to execute dex: method ID not in [0, 0xffff]: 65536
- Error : Unable to execute dex
- Error when building apk - "Multiple dex files define Lcom/google/ads/Ad"
- Unable to execute dex because of java heap space in eclipse with a tiny android application
- android eclipse unable to execute dex java heap space error
More Query from same tag
- Select Remote System Type list empty in Eclipse
- Running java application from android project in eclipse
- Executable Jar Can't Run? (Without permissions to access the code)
- cannot access memory at address 0X1 after setting up gdb and eclipse to debug shared library from Android Application
- Directories of Java class files found in Git repository cloned from BitBucket, but I can't figure out how to remove them
- unregistering the JDBC driver?
- How to properly change the package name in AndroidManifest.xml (e.g. in project zxing/barcodescanner)
- How to initialize a two-dimensional array?
- EGit requires org.eclipse.team.core
- In eclipse console can I click on Stack trace and it should take me to java instead of .class file?
- SBT local dependencies issues - some imports just does'nt work. (scala project)
- Can a single Subversion repository managed as multiple projects in Eclipse?
- how to make condition that if my GPS is not open
- Java - Check vm variables from inside eclipse?
- How to get an Android app running on API level 7 and 8?
- Page numbers only on specific pages of a report
- Create SQLite after deploying wavemaker project to phonegap
- Exporting Images with my JAR file
- Eclipse/Mac/Android: Deleting a project and recreating one with the same name
- Java ASTNode Visitor for RUBY parser DLTK
- Creating an offline map on Android
- ParserException with ical4j in Eclipse
- BIRT 4.7. Preview is not working on Eclipse IDE
- Illegal Argument Exception while Reading XML File in Java
- Custom Android Widget and Eclipse Intellisense
- Multiple versions of Android App
- Java placing text onto image not showing up
- send mail with PhoneGap without opening my mailbox
- Only changing the logo of special plugin
- Drools integrated in a web application