Unable to execute dex: Multiple dex files define Lcom/google/android/gcm/GCMBaseIntentService;

Mattias te Wierik picture Mattias te Wierik · Dec 10, 2012 · Viewed 23.5k times · Source

I'm busy for a school assignment to create a timetable app which fetches data from my database by JSON.

I use the GCM service for push notifications and Johan Nilsson's Android Actionbar.

However, when I try to export my application to an .APK file the following errors occur.

[2012-12-10 10:28:03 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/android/gcm/GCMBaseIntentService;
[2012-12-10 10:28:03 - TimeTable] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/android/gcm/GCMBaseIntentService;

While exporting an Android Dependencies map is created and creating a duplicate. Inside there is a reference to GCM and the android actionbar. While the GCM is already in the referenced libraries map after adding the gcm to the build path from the libs folder.

So after deleting the dependencies I can't run and export the application, because of the errors.

I already tried cleaning and rebuilding the app. Please help me.

Answer

CommonsWare picture CommonsWare · Dec 10, 2012

Just have one copy of the GCM JAR in libs/. Do not mess with your build path manually.