Admob 横幅和插页式广告未在启动器活动中加载 [英] Admob banner and interstitial ads not loading on launcher activity

查看:23
本文介绍了Admob 横幅和插页式广告未在启动器活动中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次加载我的应用时,横幅广告和全屏插页式广告没有加载.每隔一次,当我点击那个(或任何其他)活动时,广告就会正常加载.这使我相信这不是填充问题.我也没有使用任何中介,只是使用标准的 Admob 网络.

The first time when I load my app the banner ad and the full screen interstitial ad does not load. Every other time when i hit that (or any other) Activity the ads load fine. This leads me to believe that its not a fill issue. Also i am not using any mediation, just the standard Admob network.

下面是我用来加载横幅广告的代码

Below is the code i use to load the banner ad

AdView bannerAdView = (AdView)this.findViewById(R.id.adView);
    if (Settings.SHOW_ADS) {
        AdRequest adRequestBanner = new AdRequest.Builder().build();
        bannerAdView.loadAd(adRequestBanner);
    }

Log cat 报告如下错误

Log cat reports back the following error

10-11 21:33:51.749  19409-19439/ W/Ads﹕ There was a problem getting an ad response. ErrorCode: 0
10-11 21:33:51.839  19409-19409/ W/Ads﹕ Failed to load ad: 0
10-11 21:33:47.039  19409-19409/ E/Ads﹕ JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (:1)

有什么办法可以让广告加载率接近 100%,尤其是全屏广告?

Is there anything i can do to make the ad load close to 100% of the time, especially the full screen ad?

推荐答案

在我的 Gradle 文件中升级到最新的 google play services lib 时,此问题已消失.

This issue has disappeared when upgrading to the latest google play services lib in my Gradle file.

在撰写本文时,最新版本是 6.1.71,依赖关系如下:

At the time of writing this, the latest version is 6.1.71 and the dependancy looks like this:

compile 'com.google.android.gms:play-services:6.1.71'

这篇关于Admob 横幅和插页式广告未在启动器活动中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆