Eclipse, Android: Unexpectedly Unable to execute dex: multiple dex files define

Problem: I cannot build my project. When I try, the following sign is displayed 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 a lot of time to find a solution to this problem, but no result. I tried to clean up the project, delete the bin folder, etc., but nothing worked.

Please help, I do not know what to do ..

+6
source share
6 answers

I could not fix this, so in the end I created a new project in a different workspace and copied all the code into a new project. This is not the smartest thing, but what can I do.

+5
source

Remove android-support-annotations.jar from the libs folder. Since these annotations are already included in the latest versions of the android-support-v4.jar file.

+8
source

I lost a few hours in this problem, but I think I found solutiΓ³n, at least for mine. Andoid Studio told me that I have "Several dex files define Landroid / support / annotation / AnimRes"; but he said that he had an input file inputList.txt with an error. Well, I found this file in the directory tree, and I found it in the app / build / intermediates / tmp / dex / debug folder. A file is a simple text file that has one line for each dependency as support annotations or the androidplot-core with an absolute path.

I saw a few lines, and I thought that if I delete, I will solve the problem, but that did not work.

Then I searched this route and all .jar are in the same place: app / build / intermediates / pre-dexed / debug / folder and I saw duplicate .jar files and I deleted it after I went to the file and I also deleted the duplicate lines.

Then I run my project, and the error disappeared, the problem was resolved.

The problem was this: .jar files duplicated in this folder.

Easy!

+2
source

I have the same problem. I think this happened because there are changes in the contents of the bin folder when I update the project repository with the tortoise SVN. I deleted bin and Eclipse created a new one, but the problem still persists. But I solved the problem by removing the android dependency library. Here are the steps:

Select a project β†’ Right-click β†’ Choose build path β†’ Configure build path β†’ Libraries tab, delete Android Dependencies β†’ OK . Then clean the project and run it again. :)

+1
source

Remove the library containing android-support-v4.jar, and then add android-support-v4.jar to the direct path to buid. By the way, I am using Eclipse for the IDE.

0
source

The output to the console is "Multiple dex files".

In the bin / dexedLibs section there are many cans with the same name but with a different version.

I solve it by removing all duplicated v4 flags under all lib folders and making the link to the main project a link to one in the library project, and then cleaning up the project to rebuild. Now it works like a charm.

0
source

Source: https://habr.com/ru/post/1203570/


All Articles