1
votes
  • I got verifyed Admob ac.
  • I created key with keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key
  • I create firebase ac and connect the app, firebase approved the communication but still it gives ad error

Ad failed to load : 3

In AdvertClass

import 'dart:io';

class AdvertService {
  static final AdvertService _instance = AdvertService._internal();
  factory AdvertService() => _instance;
  MobileAdTargetingInfo _targetingInfo;
  final String _bannerAd = Platform.isAndroid
      ? 'ca-app-pub-6xxxxxxxxx01/xxxxxx5'
      : 'ca-app-pub-67xxxxxxxx01/2xxxxxx';

  AdvertService._internal() {
                                                      //USB cabled android, got that id with adb devices
    _targetingInfo = MobileAdTargetingInfo( testDevices: <String>["54a0a4f2"]);
  }
  showBanner() {
    print(_bannerAd);
    BannerAd banner = BannerAd(
        adUnitId: _bannerAd,
        size: AdSize.smartBanner,
        targetingInfo: _targetingInfo);

    banner
      ..load()
      ..show();
    banner.dispose();
  }
}
1
Is it happen on release version ? or debug only. If it doing fine on release nothing to worry about sometime Ad failed to load which is common to happen, at least on my apps does like that quiet often but on release mode it does fine, the ads show up and nothing to worry about. Try run in on release mode and see if it show up or not, flutter run --release - Aldy Yuan

1 Answers

0
votes

It's no problem, You must waiting.

The ad request was successful, but no ad was returned due to lack of ad inventory. You can read documentation: https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#ERROR_CODE_NO_FILL