Admob shows Test ads but not real ads

前端 未结 14 865
-上瘾入骨i
-上瘾入骨i 2020-12-02 22:24

I\'m using admob for showing android ads. The test ads are working fine but real ads are not shown. Also, I\'ve no issue with real interstitial ads as they work fine. Just t

相关标签:
14条回答
  • 2020-12-02 22:54

    Remove the line that says

    .addTestDevice("4CCC00EF4EA205A6FE82E1AEB26B0839")
    

    Also, when you use a virtual device, it shows the test ads no matter what. Are you testing it on a real device?

    0 讨论(0)
  • 2020-12-02 22:55

    In my case, it was because of wrong keystore file path in app > build.gradle. Make sure you have correct storeFile file('file path')

    I am sure it will help someone find the answer.

    0 讨论(0)
  • 2020-12-02 22:56

    If you chose the Native Express template then use this link. NativeExpressAdView won't work with AdView. https://firebase.google.com/docs/admob/android/native-express

    NativeExpressAdView adView = (NativeExpressAdView)findViewById(R.id.adView);
    
    <com.google.android.gms.ads.NativeExpressAdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adUnitId="ca-app-123123123123/123123123"
        ads:adSize="320x150">
    </com.google.android.gms.ads.NativeExpressAdView>
    
    0 讨论(0)
  • 2020-12-02 22:59

    If you have removed:

    .addTestDevice()
    

    Then, make sure you are using the same ID that AdMob gave you in your string.xml file

    AdMob ID page

    0 讨论(0)
  • 2020-12-02 23:04

    You might be using the sample unit id: ca-app-pub-3940256099942544/6300978111

    If you use above then you will see test ads.

    Make sure you change to your own unit id before releasing the app.

    0 讨论(0)
  • 2020-12-02 23:04

    Look at your logcat. It will say why real ads are not being shown.

    It's probably because there are none available to show for your device, in your location, right now.

    0 讨论(0)
提交回复
热议问题