AdMob的android系统" AD浏览报失踪所需的XML属性'adSize'" [英] AdMob in android "AdView missing required XML attribute 'adSize' "

查看:120
本文介绍了AdMob的android系统" AD浏览报失踪所需的XML属性'adSize'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中实现的AdMob。但不知道在某种程度上它显示这个错误并没有被,由于它生成我的R.java文件。我已经尝试了所有解决这一问题,比如清洁,建设,构建所有的方式。但不为我工作。 继我的code片段中,其示值误差,在解析XML错误:未绑定preFIX

I am trying to implement AdMob in my Application. But dont know somehow its showing this error and my R.java file is not being generated due to it. I have tried all the ways to solve this problem, like Clean,Build, Build All. But non is working for me. Following my code snippet in which its showing error "Error in parsing XML: Unbound prefix"

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:background="@color/bgcolor">

<LinearLayout
android:id="@+id/Linearlayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adSize="BANNER"
                         ads:adUnitId="XXX"
                         ads:refreshInterval="60"/>


</LinearLayout>

请帮助我。我在这里坚持:(

Please help me out. I am stuck here :(

推荐答案

大概一个命名空间的问题。你必须定义命名空间。

Probably a namespace issue. You have to define the namespace.

尝试添加

的xmlns:广告=htt​​p://schemas.android.com/apk/lib/com.google.ads

这篇关于AdMob的android系统&QUOT; AD浏览报失踪所需的XML属性'adSize'&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆