我正在尝试在我的应用程序中实施 AdMob。但不知道它以某种方式显示此错误,并且我的 R.java 文件因此没有生成。我已经尝试了所有方法来解决这个问题,例如 Clean、Build、Build All。但非对我有用。
按照我的代码片段,其中显示错误“解析 XML 时出错:未绑定前缀”
<?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>
请帮帮我。我被困在这里:(
可能是命名空间问题。您必须定义名称空间。
尝试添加
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)