Admob ads not loading - Failed to load ad: 0

后端 未结 14 975
猫巷女王i
猫巷女王i 2020-11-30 08:13

I am trying to load Admob Native ads. Previously (before app was updated) ads used to show but now they are not showing. I have posted the code, xml and the Logcat below.

相关标签:
14条回答
  • 2020-11-30 08:52

    There is no fault in your code. It's all good. You just need to wait a little. Your ad id is newly created so it will take some time to fetch ads from google servers. You can verify this by adding banner/interstitial ad id you creating for earlier applications and you'll see that they work. So give it some time and it will work soon. At least for me, it happens all the time. Can't surely say for you but why not give it a try?

    0 讨论(0)
  • 2020-11-30 08:52

    From the Documentation, Error code 0 means Internal error.

    public static final int ERROR_CODE_INTERNAL_ERROR
    

    Something happened internally; for instance, an invalid response was received from the ad server.

    Constant Value: 0

    This error generally occurs in newly created ads. So wait for few hours for the ads to be loaded.

    0 讨论(0)
  • 2020-11-30 08:53

    So I had the same error, I have tried everything listed here first.

    1. Waiting for google to send me an email saying AdMob is active. Done, it took about an hour, in fact, if you log in it will give you the status, then I waited for 48~ hours, and still the same issue

    2. The payment setup was not an issue for me because I got paid from an associated AdSense account before.

    3. Then I read all the possible common setup issues that other users here had. I mostly used the sample Admob App ID

      <meta-data
          android:name="com.google.android.gms.ads.APPLICATION_ID"
          android:value="ca-app-pub-3940256099942544~3347511713"/>
      

    And the Sample ad Unit Id given on the Admob getting started page, this way you eliminate issues with your account during development.

    1. I Was fairly sure that I had the configuration correct, but to check I downloaded Google's ad samples from GitHub. This way you can check working code, and pop your Admob App ID in and see if the account is set up correctly
    2. I started playing with the build.gradle of their sample, matching what I got to theirs, just updating and adding my dependencies. then I found it, as soon as I went to targetSdkVersion 30 and compileSdkVersion 30 the error arises. so, for now, I'm on SDK 29, till they fix this. I hope some found this useful

    Edit: The issue is reported to google check the status here, and here. it seems to affect Java and Kotlin

    0 讨论(0)
  • 2020-11-30 08:59

    You can always run your project on emulator and you will get information about "emulated ad" in your applicaiton

    0 讨论(0)
  • 2020-11-30 09:01

    When it works with the sample ad unit Ids your account probably just is not approved yet. Have you created it just now?

    Test ads worked right away for me. I had to wait several hours for the "Great news – your account is now approved" mail until my ads worked too. Do not use your own ads for development anyway - you can get your AdMob account blocked for that!

    So as soon as the test ads work and you have confirmed that the correct IDs are used for release build you most probably have done everything right and just have to wait

    There is also an test App ID "ca-app-pub-3940256099942544~3347511713" but I had no problem to use my own App ID right after creating it.

    0 讨论(0)
  • 2020-11-30 09:05

    I got this problem on my emulator API 30. I don't know why.

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