title: Flutter admob ads not showing. Ad Failed to load : 3
body: <p>Admob's test ads or normal ads not showing on my flutter app. My ad requests return this error: 'Ad failed to load: 3'. I search this error code and found it:</p>
  <pre><code>The ad request was successful, but no ad was returned due to lack of ad inventory.
  Constant Value: 3
  </code></pre>
  <p>But not only my ads, test ads also don't show. I use the google_mobile_ads package. Here's my codes:</p>
  <p>main() at main.dart:</p>
  <pre><code>void main() {
     WidgetsFlutterBinding.ensureInitialized();
     MobileAds.instance.initialize();
     runApp(MyApp());
  }
  </code></pre>
  <p>This variables at my main screen's state class (it is a stateful widget)</p>
  <pre><code>  BannerAd _ad;
    bool isLoaded = false;
  </code></pre>
  <p>The screen's initState function</p>
  <pre><code>void initState() {
      _ad = BannerAd(
          adUnitId: BannerAd.testAdUnitId,
          request: AdRequest(),
          size: AdSize.banner,
          listener: AdListener(
            onAdLoaded: (_) {
              print(&quot;loaded&quot;);
              setState(() {
                isLoaded = true;
              });
            },
            onAdFailedToLoad: (ad, error) {
              print(&quot;error: $error&quot;);
              ad.dispose();
            },
          ));
      _ad.load();
      super.initState();
    }
  </code></pre>
  <p>This condition is at bottom of main column</p>
  <pre><code>if (isLoaded)
      Container(
      width: _ad.size.width.toDouble(),
      height: _ad.size.height.toDouble(),
      child: AdWidget(ad: _ad),
      ),
  </code></pre>
  <p>Dispose method</p>
  <pre><code>  void dispose() {
      _ad?.dispose();
      super.dispose();
    }
  </code></pre>
  <p>And related part of the android/app/src/main/AndroidManifests.xml file</p>
  <pre><code>        &lt;meta-data
              android:name=&quot;com.google.android.gms.ads.APPLICATION_ID&quot;
              android:value=&quot;ca-app-pub-3940256099942544~3347511713&quot;/&gt;
      &lt;/application&gt;
  </code></pre>