I followed the official Android guide for adding interstitial ads .
If I use test mode:
AdRequest adRequest = new AdRequest.Builder() .addTestDevice("my code here") .build(); mInterstitialAd.loadAd(adRequest);
It works fine, and I see a demo adding an interstitial.
If I use release mode:
AdRequest adRequest = new AdRequest.Builder().build(); mInterstitialAd.loadAd(adRequest);
I see only black interstitial add and in the log red:
JS: Uncaught ReferenceError: AFMA_ReceiveMessage not defined (: 1)
+ Information:
- I use the latest updated google play services.
- I am trying to use 2 devices and 2 Wi-Fi networks.
- In the same device, I see other interstitial ads of other applications.
- This ad was created in adMob in the last 24 hours.
- I'm trying to load add fron stream but application crashes
- My adMob account is OK, I have other ads.
manifest:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
(...)
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />
OnCreate Action:
mInterstitialAd = new InterstitialAd(this); mInterstitialAd.setAdUnitId("here my add id"); mInterstitialAd.setAdListener(new AdListener() { @Override public void onAdClosed() { requestNewInterstitial(); } }); requestNewInterstitial();
In the application, a natural break:
if (mInterstitialAd.isLoaded()) { mInterstitialAd.show(); }
source share