我是移动广告新手。我正在PublisherAdView
中加载广告。我在onAdLoaded()
中获得回调后,就能够成功加载Ad。
以下是显示广告成功加载的日志。
I/CommonAdsUtility: loadCarouselSearchScreen() [Thread: main]
I/CommonAdsUtility: screenName: android_pnr_search [Thread: main]
I/CommonAdsUtility: card_type 2 [Thread: main]
I/CommonAdsUtility: card_ad_unit/12756069/android_pnr_search_banner [Thread: main]
I/CommonAdsUtility: loadBannerAd() [Thread: main]
I/CommonAdsUtility: adUnitId: /12756069/android_pnr_search_banner [Thread: main]
I/CommonAdsUtility: ryTag: null [Thread: main]
I/CommonAdsUtility: adSizes: [320x100_as, 320x160_as, 320x50_mb, 300x250_as, fluid, smart_banner] [Thread: main]
I/Ads: Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("B1EFAF80C6D9B2BB3EDF01B714EC2319") to get test ads on this device.
I/CommonAdsUtility: dfpCarouselEntity::: [] [Thread: main]
W/Ads: Not retrying to fetch app settings
I/CommonAdsUtility: onAdLoaded() >>> adUnitId/12756069/and_carousel_small_home [Thread: main]
I/Ads: SDK version: afma-sdk-a-v201604999.201004000.1
I/CommonAdsUtility: onAdLoaded() >>> adUnitId/12756069/android_pnr_search_banner [Thread: main]
但是,每当我预览广告素材时,都会出现错误。由于我对此没有太多经验,因此我不太了解。花了一天的时间后,现在找不到相关资源。
我已经关注:https://developers.google.com/ad-manager/mobile-ads-sdk/android/debughttps://support.google.com/admanager/answer/7160685#push
我的设备已经链接,因此无法通过Google Ad Manager控制台推送广告。这是我得到的错误。我希望我们开发人员社区中的许多人可能早些面对过。
W/Ads: Fail to get in app preview response json.
org.json.JSONException: Value KHNivylpQmwYxd6Z9gUwxfrO_QWIAYCAgKCX5rCRcw of type java.lang.String cannot be converted to JSONObject
at org.json.JSON.typeMismatch(JSON.java:111)
at org.json.JSONObject.<init>(JSONObject.java:160)
at org.json.JSONObject.<init>(JSONObject.java:173)
at com.google.android.gms.ads.internal.util.aj.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:760)
初始化过程可以正常工作:
MobileAds.initialize(mContext) { initializationStatus ->
GlobalLoggerUtils.showLog(TAG, "onInitializationComplete()")
initializationStatus.adapterStatusMap.entries.forEach {
GlobalLoggerUtils.showLog(TAG, it.value.description)
GlobalLoggerUtils.showLog(TAG, it.value.initializationState.toString())
GlobalLoggerUtils.showLog(TAG, it.value.latency.toString())
}
}
2020-05-22 00:00:08.942 I/MainApplication: onInitializationComplete() [Thread: main]
2020-05-22 00:00:08.942 I/MainApplication: [Thread: main]
2020-05-22 00:00:08.943 I/MainApplication: READY [Thread: main]
2020-05-22 00:00:08.943 I/MainApplication: 3 [Thread: main]
依赖关系:
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.19.0'
让我知道是否有任何我想念的细节或任何标签可以添加到这个问题中,以便更好地覆盖。
我已经在Google支持上创建了一个主题:https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/Xs1HtsT2934
以下是示例和视频:样本:https://drive.google.com/file/d/1F2wBFofHTPlZxs9VUb0KOArjNTFItcqj/view?usp=sharing视频:https://drive.google.com/file/d/1ZKY_2kui8X-OuErJUQdzqZLcrMcpyFRC/view?usp=sharing