Java.lang.noclassdeffounderror: Com.google.android.gms.ads.adview
Solution 1:
Adding Google Play Services support to your project
As per the Google Play Services setup guide, one does not simply "add the jars". Since GPS comes bundled with resources, you have to import it as a new seperate project, and reference it from your own, exisiting project.
Please follow the setup guide. I've just verified that I can reference AdView
successfully from my own project incorporating GPS.
Ensuring your device supports Google Play Services
GPS is an external service - it's an APK managed by the Play Store app and you need to ensure that the user has the latest GPS APK and/or one that complies with what you wanna do. Here is the guide: Ensure Devices Have the Google Play services APK.
If the device does not have GPS installed (not a Google device, special ROM, AOSP ROM, old Android, etc...) you can not use AdView.
Solution 2:
I think you should follow these steps
First step : You should login into admob account and add an app there without url.Click on manage app take ,adunitId from there in the xml layout please place following code.
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="youradunitid"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
ads:loadAdOnCreate="true"/>
Second step:In main activity ,please do not again add adview ,because you have already add adview in xml do not forget to put loadAdOnCreate = true
Third step:
You already add essential to manifest.
Fourth step :when you run on emulator it gives test ads
Fifth step :Now you are ready to launch on device
Post a Comment for "Java.lang.noclassdeffounderror: Com.google.android.gms.ads.adview"