interstitial ad show black (->) AFMA_ReceiveMessage is not defined (:1)

旧城冷巷雨未停 提交于 2019-12-23 09:38:47

问题


I followed the official guide of Android to add interstitial ads.

If I use test mode:

 AdRequest adRequest = new AdRequest.Builder()
                  .addTestDevice("my code here")
                  .build();
 mInterstitialAd.loadAd(adRequest);

Works ok and I can see the demo interstitial add.

If I use release mode:

AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);

I only see black interstitial add and in log in red:

JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (:1)

+ Info:

  • I use last updated google play services lib.
  • I try with 2 devices and 2 wifi networks.
  • In the same device I can see other apps interstitial ads
  • The ad was created in adMob in last 24 hours.
  • I try to load add fron thread but app crash
  • My adMob account is ok, I have other ads working.

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" />

Activity OnCreate:

 mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId("here my add id");
    mInterstitialAd.setAdListener(new AdListener() {
        @Override
        public void onAdClosed() {

            requestNewInterstitial();

        }
    });

    requestNewInterstitial();

In app natural break:

 if (mInterstitialAd.isLoaded()) {
           mInterstitialAd.show();
    }

回答1:


Does webview in your activity? Please comment code:

//webview.pause();

And It works.




回答2:


The problem has been solved just waiting 22 hours since the creation of ad in AdMob.



来源:https://stackoverflow.com/questions/34623597/interstitial-ad-show-black-afma-receivemessage-is-not-defined-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!