Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode
Latest ADT, Latest SDK Tools (22.3).
I Tried :
Have you checked your xml files? I have the same Problem (and it is not solved yet) and I forgot to change the adView attribute from:
<com.google.ads.AdView
android:id="@+id/adView"
to
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
then you should also chech your
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"
(dunno if this is right though...)
Edit: Found this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"/>
</LinearLayout>
(Source: https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals)
Edit2:
Ok now I solved my Problem. I am such an Idiot... Well I integrated the AdMob SDK in the services library... I deleted it and everything was great again! So delete the services_lib, download it and import again that should work I guess. Good Luck!
*Right click on project name and select the Build Path.
*Then select Configure Build Path.
*From Java Build Path select the tab Order and Export.
*Uncheck the .jar libraries.
The error is generally due to multiplicity in libraries.
Eclipse project properties->Java build path->Order and export
Uncheck Android private libraries.
Do not use jar file and library project together of google play service lib in your project.
Worked fine after delete the "GoogleAdMobAdsSdk-6.4.1.jar" from my project. Dont forget to add the Google Play Services as Library to your app. Regards!
It's because Google Play Service has google Ads in it. That's why you're having multiple dex error.
http://developer.android.com/reference/com/google/android/gms/ads/AdRequest.html
If you are using google play service as well, then there is a conflict.