Android Dex: Unable to execute DX (IntelliJ)

18.6k Views Asked by At

I follow the steps from https://stackoverflow.com/a/5271194/1973953 this link.

But when i run an application i am getting these errors

enter image description here

i have only one line in my project.properties file "target=android-11"

And this is my AndroidManifest.xml

enter image description here

So my question is why i am getting these errors and how to solve them...

6

There are 6 best solutions below

2
On BEST ANSWER

When I had this problem it was because the ActionBarSherlock library I added to my project defined the android-support-v4.jar as a compile dependency and this jar was already included in my project so there were multiple copies/version of DEX at compile time.

The solution was to change the ActionBarSherlock module dependency for this jar to be Runtime instead of compile, as my project was already providing it.

0
On

I had same problem, I had added a jar to my project lib. I deleted it and problem solved. You can check your project, undo your last changes to find the problem.

0
On

in intellij idea: go to project structure and delete one of the repeated .jar libraries [worked for me]

0
On

Check whether you added the same JAR file more than once.
If yes, remove any one of them from the libs folder and clean your project.

0
On

You cant build using an API that is not installed on your computer.

Go to your project/module settings and select an API version that you have actually installed. Or install the API version you want in your SDK. (I would just comment on @hkazemi's downvoted answer to ask why it was downvoted, because that was the fix for me. but im so rep poor, im adding an answer.)

0
On

I just changed the android SDK version in project settings (Intellij) and the error was resolved. I was using API-14 but according to SDK manager only API-19 was installed on my system. so I recommend have a look at SDK manager and see what API versions do you have and choose the right API/android version.