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

anuruddhika picture anuruddhika · Apr 9, 2014 · Viewed 21.3k times · Source

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

Answer

vishesh chandra picture vishesh chandra · Apr 9, 2014

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...