I am following a tutorial of adding a Banner Ad. But for me it gives this error.
The getter 'testAdUnitID' isn't defined for the type 'BannerAd'.
Is testAdUnitID is deprecated or something? What's the way out?
My code is:
void _initBannerAd() {
_bannerAd = BannerAd(
size: AdSize.banner,
adUnitId: BannerAd.testAdUnitID,
listener: BannerAdListener(),
request: AdRequest(),
);
}
Here is the screenshot:

Which tutorial did you watch?
found update log here.
https://pub.dev/packages/google_mobile_ads/changelog
you can get some test id for adUnitId from here.
https://developers.google.com/admob/android/test-ads
and flutter sample here.
https://developers.google.com/admob/flutter/test-ads
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