Saurav Srivastava
Saurav Srivastava

Reputation: 11

I am Unable to view ads on my flutter app with production Banner AD unit ut the same ads appears on Test Devices

(I am using flutter with google_mobile_ads package) I have tested my code using sample add unit also,everything works fine and ads shows up in test mode. I created a production ad unit and replaced my sample ad unit and its not working other tha n on the sample device.

I followed all the steps correctly,Specified on play console too that my app contains ad and the app is also signed via proper key.

This is the error i am getting :

D/DynamitePackage(30605): Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
I/Ads     (30605): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("321AC7D12BCD98148D64BD4EE67B0B17")) to get test ads on this device.
3
E/FrameEvents(30605): updateAcquireFence: Did not find frame.
I/Ads     (30605): Ad failed to load : 3
I/flutter (30605): Ad failed to load: LoadAdError(code: 3, domain: com.google.android.gms.ads, message: No ad config., responseInfo: ResponseInfo(responseId: null, mediationAdapterClassName: , adapterResponses: []))

My AD Codes :

BannerAd? myBanner;
  bool showAd = true;

  @override
  initState() {
    if (!mounted) {
      return;
    }
    apiService.setContext(context);
    apiService.setCategory(widget.initialCat);
    myBanner = BannerAd(
      adUnitId: '<AD UNIT ID>',
      size: AdSize.fullBanner,
      request: const AdRequest(),
      listener: BannerAdListener(
        onAdLoaded: (Ad ad) => print('Ad loaded.'),
        onAdFailedToLoad: (Ad ad, LoadAdError error) {
          ad.dispose();
          showAd = false;
          setState(() {});
          print('Ad failed to load: $error');
        },
        onAdOpened: (Ad ad) => print('Ad opened.'),
        onAdClosed: (Ad ad) => print('Ad closed.'),
        onAdImpression: (Ad ad) => print('Ad impression.'),
      ),
    );
    setState(() {});
    myBanner!.load();
    super.initState();
  }
showAd
                    ? Padding(
                        padding: const EdgeInsets.only(left: 15.0, right: 15.0),
                        child: Center(
                          child: StatefulBuilder(
                            builder: (context, setState) => Container(
                              decoration:
                                  const BoxDecoration(color: Colors.white),
                              height: myBanner!.size.height.toDouble(),
                              width: myBanner!.size.width.toDouble(),
                              child: AdWidget(ad: myBanner!),
                            ),
                          ),
                        ),
                      )
                    : Center(),

Upvotes: 1

Views: 1591

Answers (1)

Kaushik Chandru
Kaushik Chandru

Reputation: 17762

May be you are trying with a new ad id.. For each ad there is an inventory. Ads are filled in this inventory based on ad request. If you are recieving test ads then you can be 100% sure that your implemention is correct. We shouldn't be using production ads for testing. Once your application has considerable amount of ad request real ads will start showing.

Please check this https://groups.google.com/g/google-admob-ads-sdk/c/fBe3YL3ffpo

Upvotes: 2

Related Questions