I am using Admob Ads in my Android App.

I am getting Ads in very first week but after a week i am not getting any Ads in my App.

I am using the following code in xml File as follows.

<com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-xxxxxxxxxxxx/xxxxxxxx"
        ads:loadAdOnCreate="true"
        ads:testDevices="TEST_EMULATOR,TEST_DEVICE_ID" >
</com.google.ads.AdView>

In LogCat i am getting following Message: " onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.) "

有帮助吗?

解决方案

This error means your code haven't any problem. It just fails to find compatible add with your settings.

A possible problem is that in your Ads settings you have filtered out some ads. You can try to allow them all.

If this isn't the problem, then Admob just don't have anything to display relative to your country, the type of ads and the size of the banner.

To be sure that it is still working perfectly try to launch your apps with Admob in Test mod. It will display a test add. If this add displays correctly, you can't do more and your code is good.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top