Project File Import - android

I recently bought a new MacBook Pro and imported a couple of project files from the old laptop. Today I attempted to run an app on my device, but the project would not show in the run configurations window.I imported the file again, and got the project to show, but now I get the following error when trying to run on my device:
[2014-01-06 21:04:04 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/app/Watson$OnCreateOptionsMenuListener;
[2014-01-06 21:04:04 - Verbatim] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/app/Watson$OnCreateOptionsMenuListener;
I believe I made a mistake in the way I transferred files over from the old laptop, as well as how I imported the project into the ADT. I have no clue what the above error means and have no idea how to begin fixing it. Perhaps someone can enlighten me. Thanks!

Seems like you have multiple versions of the same projects. Dex files are what really runs Android (converted from Java, thankfully done automatically)
Try deleting all of the same projects in the adt (make sure to back that one project up just in case). Try going to the workspace folder and make sure to have only one version of it, then import it. Hope it helps

Related

Eclipse, Android: Unexpected Unable to execute dex: Multiple dex files define

The problem:
I can't built my project. When I try the following sign is shown in the Console:
[2014-09-28 23:49:30 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes;
[2014-09-28 23:49:30 - Shop] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes;
I lost hours of searching for a solution for this problem, but no result.. I tried to clean the project, to delete the bin folder etc. but nothing worked..
Please, help, I don't know what to do..
Remove android-support-annotations.jar from libs folder. As these annotations are already included in recent versions of the android-support-v4.jar file.
I couldn't fix it so I ended up by creating new project in a different workspace and copied all the code to the new project. It's not the smartest thing but what can I do..
I lost several hours too in this problem but i think that I found a solutiĆ³n, at least for my.
Andoid Studio said me that i had "Multiple dex files define Landroid/support/annotation/AnimRes;" but he said also had a file call inputList.txt that had a bug.
Well, i found this file in directory tree and i found in app/build/intermediates/tmp/dex/debug folder. The file is a simple textfile that had one row for each dependence as support-annotations or androidplot-core with a absolute path.
I saw several row repeated and i thought that if i remove i solve the problem, but it didn't work.
Then I searched this route and all .jar are in the same place: app/build/intermediates/pre-dexed/debug/ folder, and I saw repeated .jar files and I removed this, after i went to the file and I erased repeated rows too.
Then I run my project and the bug disappeared, the problem it solved.
The problem was then: .jar files duplicated in that folder.
Easy!
I have same problem. I think it was happen because there are modification in bin folder contents when I update project repository with tortoise SVN.
I have removed bin, and Eclipse generate new one but the problem still persist. But I resolved problem by removing android dependency library. Here the steps :
Select Project -> Right Click -> Select Build Path -> Configure Build Path -> In Libraries tab remove Android Dependencies -> OK. Then clean the project and run again. :)
Remove the library which contains android-support-v4.jar,then add the android-support-v4.jar to buid path direct. By the way,I use Eclipse for IDE.
As the console output said "Multiple dex files define".
Under ther bin/dexedLibs, there many jars with the same name but of different version.
I solve it by remove all the duplicated support v4 jars under all the lib folders and make my main project reference to the single one in the library project, then clean the project to rebuild.It works as a charm now.

Error while running project from eclipse

I have downloaded cocos2d x v3.3 beta and created a project in windows using this command
cocos.py new Tutorialv3cocos -p com.ghostdreamstudo.learning -l cpp -d D:\Development\Learning
Then i have imported project to eclipse and tried to run but eclipse gives me following error
[2014-10-03 18:40:39 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
[2014-10-03 18:40:39 - Tutorialv3cocos] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/cocos2dx/lib/Cocos2dxAccelerometer;
Does anyone face the same problem or know how to solve this issue??
I had this problem before and was guided to remove Android dependencies from Java Build Path and it worked every time start up eclipse and do the removing for that session. As VPatidar mentioned, new Cocos2dx has some duplicate class org/cocos2dx/lib/Cocos2dxAccelerometer in two places. Remove one then that error disappears.
For any one still has this error, do one of these:
Remove libcocos2dx sources folder in Java Build Path > Source tab
or
Remove android.library.reference.1=../cocos2d/cocos/platform/android/java from project.properties file
I chose second.

Android: Dex conversion failed while importing

I got an error while i import an android project from one workspace location to another in eclipse.
I'm using Google_admob in my project to display ads..I does't have any errors and it works well in my old workspace.
Eclipse Version : Indigo Service Release 2
Android-Project Version : Android 4.0.3
Error states :
[2012-12-03 12:02:27 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/ads/Ad;
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/ads/Ad;
i found my problem.
I actually import my lib jar file in libs_folder and also in project_libraries(External Jar)..So 2 times dex file has created in bin/dexedLibs/ ..Now i deleted one jar file from one location ..
now its working
Thanks for your support geeks..
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.

Unable to execute dex: Multiple dex files define Lcom/.... yet again

I've been searching around and there are quite a few posts relating to this issue, but there doesn't seem to be a definitive solution (eg Error when building apk - "Multiple dex files define Lcom/google/ads/Ad")
I've tried cleaning/updating/restarting eclipse - all of the things mentioned in other posts.
My project builds and I can run it on a device. But when I try and export a signed apk I get the error.
I don't get the error with other projects - all of which worked before updating adt etc but for some reason a particular project won't export...
As I say I can build the project in eclipse and run/debug it - I just can't export it.
The root cause of the problem was that one of the library was using nineoldandroid library as a jar stored in the ./libs dir , while another project was using nineoldandroid by referencing it
I was running into this issue. My situation was my application project was referencing a library project. Both were including the same external library (both use the library). Once I removed the reference to the external reference in the application project, the error went away. For me, this seemed to be that linking in the library was causing duplicate symbols, which was generating the "Multiple dex file" errors. Just a guess on my part. But, reading the above comments and other posts eventually lead me to see that I was including the library twice.
Check your build path. It is likely that you toggled 2 packages that are importing the same library (for me it was Google API that needed to be untoggled then retoggled)
in my case.. though the librari is not loaded in project.properties. it return "multiple dex bla bla bla.." I simply remove the library. and the problem solved
[Solution that worked in my case]
Right click project -> Build Path -> Configure Build Path -> Source -> Remove libCocos2dx
Was somehow building these libraries twice (since it's also included in Libraries tab)

Eclipse and Android excessive ram usage

Yesterday I had no problem with Eclipse and Android but things went mad.
http://pastebin.com/uKrCt8ee when trying to build it.
In the end:
[2011-05-01 16:19:15 - Dex Loader] Unable to execute dex: Java heap space
[2011-05-01 16:19:15 - SiNavy] Conversion to Dalvik format failed: Unable to execute dex: Java heap space
Eclipse takes ~500 MB in Task Manager and it's pretty unworkable.
I've tried cleaning project, did nothing.
Any idea ?
Update: I've renamed the old project, then i've created a new one and copied the source files. Right now it should work.
The problem went away, after I created a new project and copied files from old project to the new one.

Categories

Resources