Admob banner and interstitial ads not loading on launcher activity(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 横幅和插页式广告未在启动器活动中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Admob 横幅和插页式广告未在启动器活动中加载
基础教程推荐
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01