I'm using this to show ads:
MobileAds.initialize(this) { }
val adViewBottom = AdView(this)
adViewBottom.setAdSize(AdSize.BANNER)
if(BuildConfig.DEBUG) {
Log.d("pikaboo", "debugggg ad bottom")
adViewBottom.adUnitId = "ca-app-pub-3940256099942544/6300978111"
}else{
adViewBottom.adUnitId = "ca-app-pub-xxx"
}
binding.contentMain.adViewBottomLayout.addView(adViewBottom)
val adRequest = AdRequest.Builder().build()
adViewBottom.loadAd(adRequest)
adViewBottom.adListener = object: AdListener() {
override fun onAdLoaded() {
Log.d("pikaboo", "debugggg ad bottom loaded")
}
override fun onAdFailedToLoad(p0: LoadAdError) {
super.onAdFailedToLoad(p0)
Log.d("pikaboo", p0.toString())
}
override fun onAdOpened() {}
override fun onAdClicked() {}
override fun onAdClosed() {}
}
Until recently, everything worked with ads library that was 1 year old max.
Now I'm getting this error:
{
"Code": 3,
"Message": "No fill.",
"Domain": "com.google.android.gms.ads",
"Cause": "null",
"Response Info": {
"Response ID": "null",
"Mediation Adapter Class Name": "",
"Adapter Responses": [],
"Response Extras": {
"mediation_group_name": "Campaign"
}
}
}
How is a TEST AD supposed to be "no fill"? How can I fix it?
I finally found out that this is a problem related to GDPR advertising consents. (Google support is still investigating my support request after a week.... It was faster to do it myself...).
In my case, my app was not showing the advertising consents popup and I only had the default GDPR message set in the Play Console as active.
After implementing the GoogleMobileAdsConsentManager, showing the ad consent popup to the user, the ads were filled and displayed again (both in the test and real version).
Here is the official Google example for the banner ad: https://github.com/googleads/googleads-mobile-android-examples/tree/main/java/admob/BannerExample
If you target SDK 34, use the com.google.android.gms:play-services-ads:23.3.0 version (https://stackoverflow.com/a/79068502/2342558).
You also must set the GDPR message in the AdMob console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With