Android Dex: Unable to execute DX (IntelliJ)
Asked Answered
K

6

10

I follow the steps from https://mcmap.net/q/107922/-how-do-i-set-up-intellij-idea-for-android-applications 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...

Kratz answered 12/2, 2014 at 13:11 Comment(4)
From my point of view I would assume that you found a bug in the Dexifyer dx.jar (part of Android SDK).Ayacucho
Do you have any idea about how can i solve this problem?Kratz
Create a bug tracker entry in the android project so that Google can fix this bug in the next version.Ayacucho
Have you checked that you installed the compatible version of built tools?Clareclarence
I
23

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.

Illusage answered 16/4, 2014 at 6:31 Comment(2)
Or just remove one of two jars which repeatsHollinger
Setting it to Runtime doesn't work for me as my apps code also use android-support-v4.jar, so I set it to Provided and it works.Jaal
T
2

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.

Titty answered 15/3, 2014 at 8:22 Comment(0)
E
2

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

Esquimau answered 16/4, 2014 at 8:42 Comment(0)
D
2

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.

Dyarchy answered 29/4, 2014 at 13:0 Comment(0)
T
0

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

Travistravus answered 3/5, 2016 at 18:19 Comment(0)
S
0

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.

Southwestwardly answered 7/12, 2017 at 12:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.