I use admob in my application, it works fine, but suddenly it stopped showing ads at all. Bellow are my codes that I used:
mainActivity.xml:
<com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true" ads:adSize="BANNER" ads:adUnitId="@string/banner_ad_unit_id"> </com.google.android.gms.ads.AdView>
MainActivity.java
AdView mAdView = (AdView) findViewById(R.id.adView); AdRequest adRequest = new AdRequest.Builder().build(); mAdView.loadAd(adRequest);
AndroidManifest:
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" /> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
I followed all the instructions from the adMob website, as I said that it works a few days ago.
Below you will find a few lines from the logarithm that may be related to my problem:
09-25 22:44:50.292: E/dalvikvm(18554): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
09-25 22:45:07.209: E/Ads(18554): JS: Uncaught ReferenceError: renderAd is not defined (https://googleads.g.doubleclick.net/mads/gma:1) 09-25 22:45:07.209: E/Web Console(18554): Uncaught ReferenceError: renderAd is not defined:1 09-25 22:45:07.209: E/Ads(18554): JS: Uncaught ReferenceError: onLoad is not defined (https://googleads.g.doubleclick.net/mads/gma:1) 09-25 22:45:07.209: E/Web Console(18554): Uncaught ReferenceError: onLoad is not defined:1
I repeat the warning several times, and more appears when I click on the empty area where the ad should be displayed
09-25 22:46:10.911: W/PicturePileLayerContent(18554): Warning: painting PicturePile without content!
Filtered Log Code with "Ads"
09-25 23:39:25.948: I/Ads(28874): Starting ad request. 09-25 23:39:25.948: I/Ads(28874): Use AdRequest.Builder.addTestDevice("8FCD71CAAE776558876AAA9BA964245A") to get test ads on this device. 09-25 23:39:26.919: I/Ads(22050): App index is not enabled 09-25 23:39:30.432: E/Ads(28874): JS: Uncaught ReferenceError: renderAd is not defined (https://googleads.g.doubleclick.net/mads/gma:1) 09-25 23:39:30.442: E/Ads(28874): JS: Uncaught ReferenceError: onLoad is not defined (https://googleads.g.doubleclick.net/mads/gma:1) 09-25 23:39:30.442: I/Ads(28874): Scheduling ad refresh 60000 milliseconds from now. 09-25 23:39:30.472: I/Ads(28874): Ad finished loading.
I searched everywhere for a solution, and also looked at some similar ones, but not one of them helped me.
android admob ads
Darshan
source share