Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode and Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode

I created android application and try to add admob to it. but it not works. can anyone help me to fix this error.

[2014-04-09 15:16:51 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
[2014-04-09 15:16:51 - Aurudhu_App] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;

This is the application architecture.

enter image description here

like image 667
anuruddhika Avatar asked Apr 09 '14 09:04

anuruddhika


3 Answers

google-pay-services.jar and GoogleAdMobAdsSdk.jar having same class name for AdMob. May be due to that reason you are getting multiple .dex files.

Please follow the docs steps of this sample code link of AdMob by using google-pay-services.jar instead of GoogleAdMobAdsSdk.jar.

Hope it will help you, Still you have any problem then let me know...

like image 97
Vishesh Chandra Avatar answered Oct 07 '22 16:10

Vishesh Chandra


I had this error.

Make sure google-play-service.jar is not added twice (even in different modules...as in my case). It takes long time to debug those bugs.

like image 44
KVISH Avatar answered Oct 07 '22 14:10

KVISH


Eclipse project properties->Java build path->Order and export

Un-check Android private libraries.

like image 32
Akanksha Rathore Avatar answered Oct 07 '22 16:10

Akanksha Rathore