Unable to execute dex: multiple dex files define Lcom / actionbarsherlock / R $ attr

I created a library project for my application. When I try to add a library to the project, I get the following error when trying to start it:

[2013-02-07 04:51:26 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr; [2013-02-07 04:51:26 - testfromlibrary] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr; 

I added the HoloEverywhere library to my library, while I added the ActionBarSherlock library to HoloEverywhere. I am using Eclipse for Windows 7.

Despite the fact that I updated the SDK to the latest version, restarted Eclipse and cleared various projects, the error persists.

Does anyone know how to solve this error? My bin dir is not included in the build path by properties, and I tried to delete the bin folder .

Thanks!

+8
android eclipse actionbarsherlock dex
source share
12 answers

I indicated the cause of the error in / bin / classes. If I deleted the / classes directory before running the application, the application will compile and run. Of course, when I tried to export the application, the / classes dir directory was returned and with it an error.

The solution to my problem was to install the latest version of Eclipse. When I export or run the application through the latest Eclipse installation, the / classes folder is no longer displayed.

+5
source share

I found that if I went into properties -> Java Build Path -> Order and Export and deleted the private Android libraries, then my project was built perfectly. There was another v4 jar support that ran counter to the sherlocks file panel, which supports the v4 library.

+18
source share

This problem occurs to me when I create a library in combination with actionbarsherlock. In this case, the eclipse creates R from sherlock in my library and in the project using it.

The solution in the bin bin folder only removes the actionbarsherlock folder containing the R classes. This inst creates more and is present only in your project application.

+8
source share

the problem for me was duplication of class files. I had both the package itself and the jar sdk of the package (in the libs folder) in the same project.

+3
source share

This happened to me after I changed the usual android project to a library project in order to use it to configure the Free / Paid split.

Running any of the Free / Paid projects will result in an OP error.

The problem was that some compilation elements remained when the base project was a regular project and not a library project. Just clean your workspace and rebuild all your projects. The old compilation garbage will be deleted and everything will be compiled into the correct libraries. Try to repeat the project that gave the error, and now everything should be fine.

+3
source share

Make sure that both projects (library and application) do not have the same package name (in AndroidManifest)

+2
source share

I had the same problem today. I deleted the .apk file inside / bin, as if fixing it.

+1
source share

Remove all libraries from the build path and import the library project that you want to implement .. This works just fine.

0
source share

You can use tattletale

This helps you identify duplicate classes in your JAR files.

Hope this helps.

0
source share

For Android Studio - I removed the duplicate .jar import and was allowed.

More: I had an application in which there was a base / shared folder, and then two folders inherited from it - a free and paid version of the application. The problem was caused when I had a / shared folder and / free folder, including the same crashlytics jar file in the project structure.

0
source share

For me, the solution was to delete each JAR file in the / bin folder of the bin.

0
source share

If your project refers to a library project, check to see if the library project has the same libraries that you use in your project, but different versions . Use the same versions everywhere and everything should be in order!

0
source share

All Articles