score:94

Accepted answer

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.

score:0

i had two related but not identical guava libraries in the /libs directory, after i removed one, the problem went away.

score:0

for me i had pointed to a jar file in my builtpath which wasn't actually in that path anymore!

score:0

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)

score:0

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

score:0

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...

score:0

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!

score:0

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

score:0

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.

score:0

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.

score:0

check that your bin folder is not in the build path.

score:0

go to \bin\dexedlibs and remove all the jars of the already removed libraries, then clean

score:0

spliting google play service could help you : https://developers.google.com/android/guides/setup#split

so instead of adding just play-services :

compile 'com.google.android.gms:play-services:7.5.0'

you add only what you need :

// google maps only
compile 'com.google.android.gms:play-services-maps:7.5.0'

score:0

if you use 'com.google.android.gms:play-services' you can add what you really need to look at the following list:

google+ com.google.android.gms:play-services-plus:10.0.1

google account login com.google.android.gms:play-services-auth:10.0.1

google actions, base client library com.google.android.gms:play-services-base:10.0.1

google address api com.google.android.gms:play-services-identity:10.0.1

firebase app indexing com.google.firebase:firebase-appindexing:10.0.1 google analytics com.google.android.gms:play-services-analytics:10.0.1

google awareness com.google.android.gms:play-services-awareness:10.0.1

google cast com.google.android.gms:play-services-cast:10.0.1

google cloud messaging com.google.android.gms:play-services-gcm:10.0.1

google drive com.google.android.gms:play-services-drive:10.0.1

google fit com.google.android.gms:play-services-fitness:10.0.1

google location and activity recognition com.google.android.gms:play-services-location:10.0.1

google maps com.google.android.gms:play-services-maps:10.0.1

google mobile ads com.google.android.gms:play-services-ads:10.0.1

google places com.google.android.gms:play-services-places:10.0.1

mobile vision com.google.android.gms:play-services-vision:10.0.1

google nearby com.google.android.gms:play-services-nearby:10.0.1

google panorama viewer com.google.android.gms:play-services-panorama:10.0.1

google play game services com.google.android.gms:play-services-games:10.0.1

safetynet com.google.android.gms:play-services-safetynet:10.0.1

android pay com.google.android.gms:play-services-wallet:10.0.1

android wear com.google.android.gms:play-services-wearable:10.0.1

score:0

delete generated r package from your referenced library. sometimes clean and rebuild doesn't remove old r generated files.

score:1

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.

score:2

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

done!

score:2

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

score:2

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.

score:2

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]

then react-native run-android to build and run again.

score:3

try deleting r.java and letting eclipse re-generate it.

score:3

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.

score:3

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.

score:3

make sure that "android-support-v4.jar" is unchecked in order and export tab under java build path

follow the steps:

  1. project properties
  2. java build path
  3. order and export
  4. uncheck "android-support-v4.jar"

score:3

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!

score:4

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.

score:4

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.

score:4

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.

score:4

[solved for me]

by removing the duplicate library "jar file" then remove buildconfig.java file, clean project and its work.

score:5

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.

score:5

solution for me:

  1. back up your code!
  2. 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

  3. navigate to your eclipse directory and type this command:

    dev1:eclipse$ ./eclipse clear

  4. 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;

score:5

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.

score:6

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.

score:6

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.

score:6

modify your eclipse.ini file and set the maximum memory parameter to

-xmx1024m

then restart your computer.

it worked for me.

score:6

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)

score:6

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...

score:7

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:

  1. 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
  2. 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
  3. 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!

score:8

deleting the bin folder was not enough, i also deleted the gen folder. then after two rebuilds the dex error message was gone.

score:8

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

score:8

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

score:9

you have probably installed r14, this error may have been caused due to the platform tools update, you have to re-install your sdk

score:9

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.

score:15

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.

score:18

go to project/properties and java build path and unchecked the android private libraries.

this is also another case for this kind of error

done

score:19

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.

score:20

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.

score:23

for me, i just right click on project -> build path -> configure build path -> libraries -> remove dependency

after it works.

score:26

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

score:31

  1. close eclipse.
  2. delete bin folder inside your project folder.
  3. start eclipse and clean your project.
  4. now run and the problem should be gone

score:36

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.

score:46

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;

score:50

[solved for me]

eclipse project properties->java build path->order and export

uncheck android private libraries.

score:462

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 project name
  • select build path -> configure build path
  • in java build path, go to the tab order and export

  • uncheck your .jar library

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.


Related Query

More Query from same tag