Admob No ads appear

Asked

Viewed 3,825 times

1

I did everything right: I linked the app with firebase, only when running the ad area turns white. Now, if I use Unit id tests it works normally

Mainactivity code

    AdView mAdView = (AdView) findViewById(R.id.adView);

    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);

Layout code

   <com.google.android.gms.ads.AdView
    android:id="@+id/adView"
    android:layout_width="368dp"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="@string/banner_ad_unit_id"
    tools:layout_editor_absoluteY="8dp"
    tools:layout_editor_absoluteX="8dp">
    </com.google.android.gms.ads.AdView>

Strings

<resources>
<string name="app_name">My Application</string>
<string name="banner_ad_unit_id">ca-app-pub-
 1770401303076452/1027518523</string>
 </resources>
  • You have to wait about a few hours for the ad to appear.

  • Thank you, I thought I had done something wrong

  • You added in a Relativelayout?

  • Now it appeared normal , except that the admob website clicks counter does not leave the 0

  • You know that according to the policies the dveloper can not keep clicking on the banners right?! And another, clicks are not computed on the fly, just like the banner is not shown when you create a campaign.

  • I was only doing a test to see if everything went well , thanks friend!

  • What does the log show? When you run the log instructs you to add the device as a test ID in Uilder, so you see a test ad that usually appears faster than the real ad, which will solve your question faster.

  • Paiva, did any answer solve your problem? Would there be something else we can explain?

Show 3 more comments

2 answers

1

only when running the ad area it turns white

Test directly on the device or to test with emulators, you can try this way:

AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).build();

Now it appeared normal , except that the clicks counter admob does not leave 0

It will usually update next day. It’s not quite in real time like Google Analytics.

Adview mAdView = (Adview) findViewById(R.id.adView);

By this line, I believe that your Android Studio is outdated, as there is no more need to do the cast plus. Always try to keep your IDE up to date because sometimes some errors are solved with just this.

0

If you just created the ad on admob, it takes a while for the ad to start airing. And if you are using emulator android studio, will only appear test ad, even vc using normal ad.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.