AdMob的android系统" AD浏览报失踪所需的XML属性'adSize'"所需、属性、系统、QUOT

2023-09-09 22:07:33 作者:陌路人°

我想在我的应用程序中实现的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