android admob不显示任何添加虽然配置所有需要的设置

时间:2014-05-26 05:16:07

标签: android admob

大家好我正在创建一个应用程序,因为我需要添加ad-mob标题,因为我得到了像这个键一样的ca-app-pub-00000000000000/000000000。 我的logcat说:

  

05-26 05:56:21.241:W / Ads(1803):无效的未知请求错误:不能   确定请求类型。您的广告单元ID是否正确?

(我的密钥代码替换为0) 现在我把这个( 与同一单位ID我的全屏添加成功加载(InterstitialAd))

<com.google.ads.AdView
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:id="@+id/ad"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    ads:adSize="BANNER"
    ads:loadAdOnCreate="true"
    ads:adUnitId="ca-app-pub-00000000000000/000000000/>//puted here my key 

在我的清单文件中

<activity
    android:name="com.google.ads.AdActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

但它仍然没有显示任何添加 我做错了什么? 任何人都可以向我推荐解决方案吗?

使用相同的单位ID,我的全屏添加成功加载 - InterstitialAd

4 个答案:

答案 0 :(得分:0)

请将此行添加到您的主要版面并从AdView中删除

 xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"

可能有帮助。

答案 1 :(得分:0)

也许你应该为它指定位置

android:layout_alignParentBottom="true"

并将此行放入主要布局中,如Prateek所说

xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads"

答案 2 :(得分:0)

您无需在市场上拥有应用即可获取新应用的发布商ID。在“添加网站/应用”表单中的Android包URL字段中,只需输入“market:// details?id = your.package.name”。您当然希望将“your.package.name”替换为您应用的实际包名。

viewWidth警告很好,插入发布商ID后,您可能仍会看到它们。

请参阅以下链接..

How to get Google's example code working for AdMob 4.1.0 using an Android device

AdMob 4.3.1 adds not showing up (No AdMob ID yet (just for test), can't get ViewWidth)

答案 3 :(得分:0)

横幅广告和插页式广告应该有不同的AdUnitIds。尝试在横幅广告中使用insterstitial ID可能是您的问题。

在Admob信息中心中创建单独的横幅广告adUnit并使用它。