<?xml version="1.0" encoding="UTF-8"?>
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>
我的 adview XML 文件的代码
错误:未绑定(bind)前缀。
xmlns:android="http://schemas.android.com/apk/res/android"
最佳答案
既然您正在尝试集成 AdMob,请尝试更改:
xmlns:ads="http://schemas.android.com/apk/res-auto"
对此:
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
此外,您还有一个从未打开过的relativelayout的结束标记。
关于java - 如何修复此未绑定(bind)前缀错误?不知道我错过了什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54675806/