Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

admob banner live ad not showing but test showing

MainActivity code:

MobileAds.initialize(this, getResources().getString(R.string.app_id));
mAdView = findViewById(R.id.adView);
            mAdView.setVisibility(View.VISIBLE);
            AdRequest adRequest = new AdRequest.Builder().build();
            mAdView.loadAd(adRequest); 

main_activity.xml file

 <com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-7758424290736454/1358492948" />

 

when i add Test ID ad is showing.:

ca-app-pub-3940256099942544/6300978111

i am getting below error logs

DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
    01-29 16:19:28.141 6523-6523/com.recreation.cryptocurrencyrate I/art:     at void com.google.android.gms.ads.MobileAds.initialize(android.content.Context, java.lang.String, com.google.android.gms.ads.MobileAds$Settings) ((null):-1)
    01-29 16:19:28.141 6523-6523/com.recreation.cryptocurrencyrate I/art:     at void com.google.android.gms.ads.MobileAds.initialize(android.content.Context, java.lang.String) ((null):-1)
    01-29 16:19:28.142 6523-6523/com.recreation.cryptocurrencyrate I/art:     at void com.google.android.gms.ads.MobileAds.initialize(android.content.Context, java.lang.String, com.google.android.gms.ads.MobileAds$Settings) ((null):-1)
    01-29 16:19:28.142 6523-6523/com.recreation.cryptocurrencyrate I/art:     at void com.google.android.gms.ads.MobileAds.initialize(android.content.Context, java.lang.String) ((null):-1)
    01-29 16:19:30.961 6523-6523/com.recreation.cryptocurrencyrate I/Ads: Starting ad request.
    01-29 16:19:30.961 6523-6523/com.recreation.cryptocurrencyrate I/Ads: This request is sent from a test device.
    01-29 16:19:30.972 6523-6523/com.recreation.cryptocurrencyrate W/Ads: Not retrying to fetch app settings
    01-29 16:19:33.499 6523-6540/com.recreation.cryptocurrencyrate W/Ads: There was a problem getting an ad response. ErrorCode: 0
    01-29 16:19:33.506 6523-6523/com.recreation.cryptocurrencyrate W/Ads: Failed to load ad: 0

Admob App Unit id dashboard.

admob account dasboard

like image 816
Abdul Qadir Avatar asked Nov 08 '22 11:11

Abdul Qadir


1 Answers

Your Adunit Id is newly created so it will take time to review adunit and displaying ads in your app. Problem is with your created adunit Id. Its displaying test ads to me in my app with your AdUnit Id.

Follow below steps :-

To create a Live Ad unit id

Sign In to

https://apps.admob.com

in the left side menu click on ->Apps add app choose whether you have published your app on Google Play or the App Store if no -> Enter your app information Create Ad unit replace the test Ad unit with the new Ad unit. you get to see the AD once the app is published to playstore!

like image 85
PRATEEK BHARDWAJ Avatar answered Nov 14 '22 23:11

PRATEEK BHARDWAJ