【问题标题】:admob xlmns settings for the ad error "required xml attribute adsize was missing"广告错误“缺少所需的 xml 属性 adsize”的 admob xlmns 设置
【发布时间】:2014-10-04 03:08:22
【问题描述】:

在 admob testad 中,在 xmlns:ads 设置中,我们使用哪个?

1) http://schemas.android.com/apk/lib/com.android.google.gms.ads

2) http://schemas.android.com/apk/lib/com.google.ads

3)http://schemas.android.com/apk/res-auto

在谷歌开发者网站中,没有使用3),但是当我使用它时,根本没有出现广告。但是当我选择 1) 或 2) 时,我得到一个错误代替广告。带有红色文字的黑色背景,上面写着“缺少必需的 xml 属性 adsize”..

【问题讨论】:

    标签: android admob


    【解决方案1】:

    你可以在你的 xml 文件中试试这个东西。

    <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"
    ads:adUnitId="YOUR_AD_UNIT_ID"
    ads:adSize="BANNER"/>
    

    或在您的代码中按照thisthis 教程获取admob

    【讨论】:

      猜你喜欢
      • 2011-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多