Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 308
Mattias te Wierik Avatar asked Dec 10 '12 09:12

Mattias te Wierik


3 Answers

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

like image 133
CommonsWare Avatar answered Oct 14 '22 05:10

CommonsWare


Untick the admob jar file in the "order and export" part of the "configure build path".

It worked for me right away...

I tired every thing like deleting Bin directory or deleting gen directory, restarting Eclipse or cleaning and building again but nothing worked except for above step.

like image 39
ramit girdhar Avatar answered Oct 14 '22 04:10

ramit girdhar


I unchecked google-play-services.jat in the "order and export" part of the "configure build path" and then in worked.

like image 33
user2996950 Avatar answered Oct 14 '22 06:10

user2996950