颤抖:firebase_admob广告没有展示

时间:2018-09-06 13:37:19

标签: admob flutter

我相信我会严格按照以下步骤操作: https://pub.dartlang.org/packages/firebase_admob

...但是什么也没有。没有真实的广告,没有测试的广告,“ flutter run”中没有任何内容,在“ flutter build”中没有任何内容。我尝试了InterstitialAd.testAdUnitId和FirebaseAdMob.testAppId和testDevices ...

我所能得到的是:

W/Ads: There was a problem getting an ad response. ErrorCode: 0
W/Ads: Failed to load ad: 0
W/flutter: onAdFailedToLoad: 0

我在Android Monitor中看到了这个

E/Ads: Error waiting for future.
java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException
at com.google.android.gms.ads.internal.util.future.ae.get(:com.google.android.gms@13278037@13.2.78 (100400-210410490):11)
at com.google.android.gms.ads.internal.util.future.g.a(:com.google.android.gms@13278037@13.2.78 (100400-210410490):13)
at com.google.android.gms.ads.internal.request.service.c.a(:com.google.android.gms@13278037@13.2.78 (100400-210410490):65)
at com.google.android.gms.ads.internal.request.service.c.a(:com.google.android.gms@13278037@13.2.78 (100400-210410490):198)
at com.google.android.gms.ads.internal.request.service.f.run(:com.google.android.gms@13278037@13.2.78 (100400-210410490):1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.util.concurrent.TimeoutException
at com.google.android.gms.ads.internal.util.future.m.run(Unknown Source:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764)

我没有安装任何广告拦截功能,问题不取决于互联网连接的类型(WiFi与移动)...

有一次我放弃了。几天后,我再次尝试了该应用,但确实看到了一些广告。但是第二天,它们又消失了-应用程序没有任何更改,甚至没有重建/重新安装。

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.7.6-pre.57, on Mac OS X 10.13.5 17F77, locale cs-CZ)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2017.3.5)
[✓] Connected devices (1 available)

2 个答案:

答案 0 :(得分:0)

广告必须先加载才能显示。该功能加载后,广告可能需要3到10秒钟才能载入。问题是,如果调用loadAd函数,则返回广告需要花费几秒钟的时间,此时showAd已经执行,由于广告仍在加载,因此将返回错误。报告为github上的错误。应将loadAd函数添加到插件本身的流的末尾。

答案 1 :(得分:0)

可能的原因: Android清单或跑步者info.plist文件中的互联网权限 Firebase Admob的错误代码 应用ID而不是广告单元ID的位置错误 互联网服务提供商防火墙