3

I am trying to create an Android app which is based on tomP2P. And, I have added all the jar files by following instructions from (Adding a library/JAR to an Eclipse Android project "here")! Now when I try to run the app, I get following error:

[2014-03-17 14:57:56 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/hamcrest/Description;
[2014-03-17 14:57:56 - MediaSenseAndroidApp] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/hamcrest/Description;

I have tried with both Eclipse and Android Studio. Any help would be highly appreciated! Thanks. Few hints: When I uncheck the jars from properties -> Java Build Path -> order and export, this error goes away. However, then the following error shows up:

E/AndroidRuntime(848): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{se.mediasense.mediasenseandroidapp/se.mediasense.mediasenseandroidapp.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "se.mediasense.mediasenseandroidapp.MainActivity" on path: DexPathList[[zip file "/data/app/se.mediasense.mediasenseandroidapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/se.mediasense.mediasenseandroidapp-2, /system/lib]]
Community
  • 1
  • 1
suzon_
  • 41
  • 1
  • 5
  • Unable to execute dex: Multiple dex files Means that you use use 2 or more same files in particular projet and they having different different version numbers . For Example : you use many Libraries in any project and and they have different `android-support-v4.jar` library. In this case this error accure, Best way to solve this problem is to use only one type of file. – Amarjit Mar 17 '14 at 17:04
  • It will be helpful if you can outline your eclipse workspace folder structure. Like @neeni rightly mentioned, this error occurs when Android Dex Loader loads more than one dex file for one class(type). The android dex file can analogized to a .class file in plain Java. – aravind Mar 17 '14 at 19:56

0 Answers0