I am new to Mobile Ads. I am loading an Ad in PublisherAdView
. I am successfully able to load Ad as I am getting the callback in onAdLoaded()
.
The following are the logs that say Ad load successfully.
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]
However, whenever I preview a creative I am getting an error. Since I am not much experienced in this I don't understand this exactly. And could not find related resources now after spending a day on this.
I have followed: https://developers.google.com/ad-manager/mobile-ads-sdk/android/debug https://support.google.com/admanager/answer/7160685#push
My device is already linked and pushing the creative from Google Ad Manager console doesn't work for me. This is the error I am getting. I am hoping many of us from the developer community might have faced this earlier.
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)
The initialization process works fine:
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]
Dependency:
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.19.0'
Opening the debug menu to preview creative
Let me know if there are any details I am missing out or any tag to add to this question for better reach.
I have created a thread on Google Support: https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/Xs1HtsT2934
Here is a sample and video for the same: Sample: https://drive.google.com/file/d/1F2wBFofHTPlZxs9VUb0KOArjNTFItcqj/view?usp=sharing Video: https://drive.google.com/file/d/1ZKY_2kui8X-OuErJUQdzqZLcrMcpyFRC/view?usp=sharing
Finally, the has been recognized and acknowledged by Google's Mobile Ads SDK Team.
It seems a number of publishers have reported this and a fix is in progress and at this stage is tentatively scheduled for release next week (week of June 15). This will be a server-side fix so no new SDK required.
Will let you know when I have confirmation of the fix in production.
Fixes are done and are live now.