Firebase Admob Ads not showing even after a month, ad failed to load

1,062

Did you set up your payment details on your Admob account? After you provide your payment details it takes about a day to show ads on your app.

Share:
1,062
SagarRawat
Author by

SagarRawat

Updated on December 25, 2022

Comments

  • SagarRawat
    SagarRawat over 1 year

    I am trying to implement Firebase Admob to my app and I tried using banner ad the ads are showing when test ids are but not when real app-ids are used. I waited for about a month still no ads. I read the documentation all good according to them still no luck error log shows ad failed to load 3 don't know what is causing this. thanks.

          class ImagePath extends StatefulWidget {
            final String imgPath;
            ImagePath(this.imgPath);
            @override
            _ImagePathState createState() => _ImagePathState();
          }
    
          class _ImagePathState extends State<ImagePath> {
            String localPath;
    
            static const MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
              testDevices: testDevice != null ? <String>[testDevice] : null,
              nonPersonalizedAds: true,
              keywords: ["website", "games"],
            );
    
            BannerAd bannerAd;
            BannerAd createBannerAd() {
              return BannerAd(
                  adUnitId: "AD-ID-HERE",
                  size: AdSize.banner,
                  targetingInfo: targetingInfo,
                  listener: (MobileAdEvent event) {
                    print("BannerAd $event");
                  });
            }
    
            @override
            void initState() {
              FirebaseAdMob.instance
                  .initialize(appId: "APP-ID-HERE");
              bannerAd = createBannerAd()
                ..load()
                ..show(anchorType: AnchorType.bottom);
              super.initState();
            }
    
            @override
            void dispose() {
              bannerAd?.dispose();
              super.dispose();
            }
    
            Future<String> get localpath async {
              final result = await Permission.storage.request();
              if (result == PermissionStatus.granted) {
                final localPath =
                    (await findLocalPath()) + Platform.pathSeparator + 'Download';
                final savedDir = Directory(localPath);
                bool hasExisted = await savedDir.exists();
                if (!hasExisted) {
                  savedDir.create();
                }
                return localPath;
              } else
                return null;
            }
    
            Future<String> findLocalPath() async {
              final directory = Platform.isAndroid
                  ? await getExternalStorageDirectory()
                  : await getApplicationDocumentsDirectory();
              return directory.path;
            }
    
            @override
            Widget build(BuildContext context) {
              return Scaffold(
                appBar: AppBar(
                  backgroundColor: bgColor,
                  leading: IconButton(
                    icon: Icon(Icons.close),
                    onPressed: () => Navigator.of(context).pop(),
                    color: Colors.white,
                  ),
                  actions: [
                    IconButton(
                        color: Colors.white,
                        icon: Icon(Icons.file_download),
                        onPressed: () async => DownloadTask(
                            taskId: await FlutterDownloader.enqueue(
                                url: widget.imgPath,
                                savedDir: await localpath,
                                showNotification: true,
                                openFileFromNotification: true)))
                  ],
                ),
                body: SizedBox.expand(
                  child: Container(
                    child: Stack(
                      children: [
                        Align(
                          alignment: Alignment.center,
                          child: Hero(
                              tag: widget.imgPath, child: Image.network(widget.imgPath)),
                        ),
                      ],
                    ),
                  ),
                ),
                backgroundColor: bgColor,
              );
            }
          }
    

    error log -

                 D/ActivityThread(29222): holder:android.app.IActivityManager$ContentProviderHolder@c4e7070, holder.provider:android.content.ContentProviderProxy@a482fe9
                D/DynamitePackage(29222): Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
                I/WebViewFactory(29222): Loading com.google.android.webview version 86.0.4240.110 (code 424011000)
                W/ResourceType(29222): Found multiple library tables, ignoring...
                I/System  (29222): FinalizerDaemon: finalize objects = 289
                D/WebView (29222): WebView<init>
                I/cr_LibraryLoader(29222): Loaded native library version number "86.0.4240.110"
                I/cr_CachingUmaRecorder(29222): Flushed 5 samples from 5 histograms.
                E/chromium(29222): [ERROR:filesystem_posix.cc(62)] mkdir /data/user/0/sagarrawatuk.fotoApp/cache/WebView/Crashpad: No such file or directory (2)
                D/ConnectivityManager.CallbackHandler(29222): CM callback handler got msg 524290
                D/WebView (29222): addJavascriptInterface=googleAdsJsInterface
                D/WebView (29222): removeJavascriptInterface=accessibility
                D/WebView (29222): removeJavascriptInterface=accessibilityTraversal
                D/WebView (29222): loadUrl=https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/production/sdk-core-v40-impl.html
                W/cr_media(29222): Requires BLUETOOTH permission
                V/SettingsInterface(29222): invalidate [secure]: current 2 != cached 0
                E/libEGL  (29222): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
                D/ActivityThread(29222): holder:android.app.IActivityManager$ContentProviderHolder@90636e7, holder.provider:android.content.ContentProviderProxy@a09f294
                D/DynamitePackage(29222): Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
                D/SettingsInterface(29222):  from settings cache , name = android_id , value = e6623267e10d401e
                I/Ads     (29222): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("0D97118CC9A4746D5FDA6A253D5479F1") to get test ads on this device.
                D/MPlugin (29222): createInstance(): Begin = 485050486
                D/MPlugin (29222): create Instance (two parameters) with : com.mediatek.common.telephony.IOnlyOwnerSimSupport
                D/MPlugin (29222): Clazz exists on mapping table : false
                E/MPlugin (29222): Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
                D/MPlugin (29222): createInstance(): End = 485050486
                I/DynamiteModule(29222): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:203404601
                I/DynamiteModule(29222): Selected remote version of com.google.android.gms.ads.dynamite, version >= 203404601
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_enabled , value = 0
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_font_scale , value = null
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_locale , value = null
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_preset , value = null
                D/libc-netbsd(29222): [getaddrinfo]: hostname=googleads.g.doubleclick.net; servname=(null); netid=0; mark=0
                D/libc-netbsd(29222): [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
                W/Ads     (29222): Not retrying to fetch app settings
                D/libc-netbsd(29222): getaddrinfo: googleads.g.doubleclick.net get result from proxy gai_error = 0
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_enabled , value = 0
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_font_scale , value = null
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_locale , value = null
                D/SettingsInterface(29222):  from settings cache , name = accessibility_captioning_preset , value = null
                D/libc-netbsd(29222): [getaddrinfo]: hostname=googleads.g.doubleclick.net; servname=(null); netid=0; mark=0
                D/libc-netbsd(29222): [getaddrinfo]: ai_addrlen=0; ai_canonname=(null); ai_flags=1024; ai_family=0
                W/Ads     (29222): Not retrying to fetch app settings
                D/libc-netbsd(29222): getaddrinfo: googleads.g.doubleclick.net get result from proxy gai_error = 0
                D/OpenSSLLib(29222): OpensslErr:Module:12(116:176); file:external/boringssl/src/crypto/asn1/asn1_lib.c ;Line:186;Function:ASN1_get_object
                D/OpenSSLLib(29222): OpensslErr:Module:12(116:176); file:external/boringssl/src/crypto/asn1/asn1_lib.c ;Line:186;Function:ASN1_get_object
                W/flutter (29222): onAdFailedToLoad: 3
                I/Ads     (29222): Ad failed to load : 3
                I/flutter (29222): BannerAd MobileAdEvent.failedToLoad
                D/SQLiteDatabase(29222): beginTransaction()
                D/SQLiteDatabase(29222): endTransaction()
                D/SQLiteDatabase(29222): beginTransaction()
                D/SQLiteDatabase(29222): endTransaction()
                D/WebView (29222): evaluateJavascript=(function(){})()
                D/WebView (29222): evaluateJavascript=google.afma.config.fetchAppSettings({"id":"1728bed4-cfbf-449f-a186-a71cd6e27ce4","args":{"app_id":"APP_ID","is_init":true,"pn":"sagarrawatuk.fotoApp"}});
    
    • griffins
      griffins over 3 years
      show error logs
    • SagarRawat
      SagarRawat over 3 years
      error logs added
    • griffins
      griffins over 3 years
      trying to find an anwer i had answered on this. basically your app is not receiving ads as seen here Ad failed to load : 3 .if your app has few users you might wait longer
  • SagarRawat
    SagarRawat over 3 years
    I think I have done that , I linked it to my adsense account
  • F L
    F L over 3 years
    You can verify that in your Admob account > Payments. If it shows a blank screen or a progress bar that never loads, try on different browsers
  • SagarRawat
    SagarRawat over 3 years
    yes ,it says "You don't need a payment method until your earnings threshold has been reached"
  • user37309
    user37309 over 3 years
    Getting this too - no ads after a week and test ads are working fine on the android version of the app, but not on iOS. Plenty of requests, match rate 0. But can't add payment details as SagarRawat says
  • F L
    F L over 3 years
    you're getting the same message as him or a blank screen?