Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何修复此未绑定前缀错误?Don';我不知道我错过了什么_Java_Android_Xml_Ads - Fatal编程技术网

Java 如何修复此未绑定前缀错误?Don';我不知道我错过了什么

Java 如何修复此未绑定前缀错误?Don';我不知道我错过了什么,java,android,xml,ads,Java,Android,Xml,Ads,xmlns:ads=”http://schemas.android.com/apk/res-auto" android:layout\u height=“match\u parent” android:layout\u width=“匹配父项” android:paddingLeft=“@dimen/activity\u水平\u边距” android:paddingRight=“@dimen/activity\u水平\u边距” android:paddingTop=“@dimen/activit

xmlns:ads=”http://schemas.android.com/apk/res-auto"
android:layout\u height=“match\u parent”
android:layout\u width=“匹配父项”
android:paddingLeft=“@dimen/activity\u水平\u边距”
android:paddingRight=“@dimen/activity\u水平\u边距”
android:paddingTop=“@dimen/activity\u vertical\u margin”
android:paddingBottom=“@dimen/activity\u vertical\u margin”
工具:context=“.MainActivity”
package=“com.app”>
我的AdviewXML文件的代码

错误:未绑定前缀


xmlns:android=”http://schemas.android.com/apk/res/android“

由于您正在尝试集成AdMob,请尝试更改:

xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
package="com.app">

<com.admob.android.ads.AdView
    android:id="@+id/MainActivity"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ca-app-pub-"
    android:name="com.admob.android.ads.AdView"/>
<com.admob.android.ads.AdView/>
</RelativeLayout>
为此:

xmlns:ads="http://schemas.android.com/apk/res-auto"
此外,您还有一个从未打开过的RelativeLayout的结束标记

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