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 横幅和插页式广告未在启动器活动中加载


- android 4中的android RadioButton问题 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01