0

I've seen this error reported several times, but none of the solutions I have read seem to help me. I'm getting the following error:

Dex Loader] Unable to execute dex: Multiple dex files define Landroid/annotation/SuppressLint;
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/annotation/SuppressLint;

I did some digging around and I'm seeing these jar files in the /bin/dexedLibs folder:

android-support-v4-198bc014c99a20da45e22ed9cbf6acfc.jar
annotations-548f83e84eb7d75caedbdd94af586669.jar
annotations-c206a845ecee15ca74bd8ea29f715ccd.jar
google-play-services-90fd245eca6bf1f2b0d2bb25ec3948cc.jar
google-play-services_lib-6007bc6f3ac755b4866fa4a11c4e1704.jar
guice-3.0-no_aop-12e0ac277316bccd821359aa41181ed8.jar
javax.inject-384e1baadfa688e537ac642df7b9e932.jar
jsr305-1.3.9-13c6c964842f2bc7643c588e6fdc4754.jar
ormlite-android-4.47-185a20bcc9d996b5de6d6ca2aff0d0d5.jar
ormlite-core-4.47-42acd47179ed45763a3ec81ac92a2f20.jar
roboguice-2.0-f9de91c4687c33313255e5dd6fd324b3.jar
simple-xml-2.7.1-d80fa5a8427ec77885976924091eb340.jar
teklibrary-core-1.0.0-SNAPSHOT-cd7381a5468da36c532837d7604e95b3.jar

See the duplicate annotations and google_play_services jar files. This is what my eclipse looks like. I don't know how Google Play Services and Annotations are appearing in both Android Private Libraries and Android Dependencies.

enter image description here

This is where my Google Play Services is getting added to the project. The reason I have it added that way was due to an issue with the following line in code in AndroidManifest.xml where @integer/google_play_services_version wasn't being recognized.

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

enter image description here

In Project Properties | Java Build Path | Order and Export, I have unchecked Android Dependencies.

enter image description here


So the question, anyone know how to resolve this issue:

[2013-11-29 10:30:49 - TekJobsAppAndroid2] Dx 
trouble writing output: already prepared
[2013-11-29 10:30:49 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/annotation/SuppressLint;
[2013-11-29 10:30:49 - TekJobsAppAndroid2] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/annotation/SuppressLint;

Thanks in advance

Please note that I consistently do the following:

  • Delete the contents of the BIN folder
  • Clean Project
  • Build Project
Salsero69
  • 2,160
  • 3
  • 23
  • 27
  • See the answer here: http://stackoverflow.com/questions/7870265/unable-to-execute-dex-multiple-dex-files-define-lcom-myapp-rarray – stefana Nov 29 '13 at 15:49
  • clean project and if it still fails, see what happens if you remove the annotations.jar from the libs folder. – zapl Nov 29 '13 at 16:16
  • I removed the annotations.jar and now I'm getting 'Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.' error. Put the lib back in and error won't go away. Deleted the bin folder, cleaned the project and no go. I saw this post http://stackoverflow.com/questions/19727915/android-dex-gives-a-bufferoverflowexception which might resolve it, but need to find that version of the tool. – Salsero69 Nov 29 '13 at 18:01

1 Answers1

1

Open Java Build Path ->Open Libraries Tab-> Expand all ->Find Duplicate -> Remove Them.

Delete Bin Folder. Clean Project

Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66
  • I deleted Android Dependencies (didn't know I was allowed), deleted the BIN folder and Clean Project with no change. – Salsero69 Nov 29 '13 at 18:00
  • What all jar files are you using ? – Rahul Gupta Nov 29 '13 at 18:09
  • Dude you have two annotations.jar and two google-play-services jar. Remove duplicates. That is why this error is coming – Rahul Gupta Nov 29 '13 at 18:10
  • I know that, should have mentioned it above. I don't know why I had the duplicates, but deleting Android Dependencies took care of that. But now I have another error. 'Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.' – Salsero69 Nov 29 '13 at 18:22
  • http://stackoverflow.com/questions/19741758/bufferoverflowexception-when-building-application – Rahul Gupta Nov 29 '13 at 18:28