android - AdMob 广告停止在一个应用中展示

标签 android admob ads

我在我的应用程序中正确设置了 Admob,它之前可以正常工作,但现在它停止显示广告并出现流动错误:

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.

奇怪的是,如果我更改我的应用程序的包名称,它就会开始显示广告,是否有人面临同样的问题或我的问题的任何解决方案?

我使用了以下单元广告 ID:

<string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string> 

在获取测试广告的说明中提供

以下是我的 mainActivity.java 代码:

AdView mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);

请给我解决这个问题...

以下是 admob 的 Manifest.xml 代码:

<!-- Include required permissions for Google Mobile Ads to run-->
    <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" />

         <!--Include the AdActivity configChanges and theme. -->
        <activity android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />

最佳答案

Whats strange is it starts showing ads if i change the package name of my app

通常这意味着您的应用程序已因某种原因被 AdMob 暂停。我建议首先检查您的 AdMob 帐户是否信誉良好。

关于android - AdMob 广告停止在一个应用中展示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32801337/

相关文章:

android - 使用共享首选项显示启动画面一次

flutter - Flutter:admob构建成功,但随后崩溃

Android 广告大大降低了性能

asp.net - 使用 IFRAME 制作简单的广告。对SEO不利吗?

android - 滑动清除应用程序时广播接收器停止触发

Android布局 View ID名称问题

java - 尝试使用 AsyncTask 读取 RSS 时更新 UI,但不起作用

ios - 适用于 iOS 的 AdMob 错误 : Llibrary not found for -lGoogleAdMobAds

java - Android检测卸载和打开 Intent