Search code examples
flutteradmob

rewarded test ads show no ad config error in flutter


I have added the permission and test app id in the manifest but still rewarded ad is not loading while the banner and interstitial were loaded. is there any solution how can I show the test rewarded ad

  RewardedAd? _rewardedAd;

  var adUnitId = 'ca-app-pub-3940256099942544/5224354917';

void loadAd() {
    RewardedAd.load(
        adUnitId: adUnitId,
        request: const AdRequest(),
        rewardedAdLoadCallback: RewardedAdLoadCallback(
          // Called when an ad is successfully received.
          onAdLoaded: (ad) {
            ad.fullScreenContentCallback = FullScreenContentCallback(
                // Called when the ad showed the full screen content.
                onAdShowedFullScreenContent: (ad) {},
                // Called when an impression occurs on the ad.
                onAdImpression: (ad) {},
                // Called when the ad failed to show full screen content.
                onAdFailedToShowFullScreenContent: (ad, err) {
                  // Dispose the ad here to free resources.
                  ad.dispose();
                },
                // Called when the ad dismissed full screen content.
                onAdDismissedFullScreenContent: (ad) {
                  // Dispose the ad here to free resources.
                  ad.dispose();
                },
                // Called when a click is recorded for an ad.
                onAdClicked: (ad) {});

            print('$ad loaded.');
            // Keep a reference to the ad so you can show it later.
            _rewardedAd = ad;
          },
          // Called when an ad request failed.
          onAdFailedToLoad: (LoadAdError error) {
            print('RewardedAd failed to load: $error');
          },
        ));
  }

The error is :

"com.google.android.gms.ads"
message:
"No ad config."

Solution

  • Problem is solved it was a problem with the test unit rewarded ad id when used real one it worked perfectly without any changes