gpt4 book ai didi

android - 错误 : Error parsing XML: unbound prefix in admob

转载 作者:行者123 更新时间:2023-11-29 14:20:50 24 4
gpt4 key购买 nike

我尝试了很多组合,但它在 xml 文件中显示以下错误

error: Error parsing XML: unbound prefix

<com.google.ads.AdView行,我该如何解决这个问题。

   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<com.google.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:adUnitId="000000000000000"
myapp:adSize="BANNER"
myapp:refreshInterval="30"
/>
</RelativeLayout>
<ListView
android:id="@+id/list_of_wishes"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:dividerHeight="2dip"

android:clickable="true" >
</ListView>


</LinearLayout>

最佳答案

我认为您应该使用 ads: 而不是 myapp:,但我可能错了。如果这对您不起作用,请告诉我:

<com.google.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adUnitId="000000000000000"
ads:adSize="BANNER"
ads:refreshInterval="30"
/>

这可能有帮助的原因是您设置了 ads 命名空间,但没有设置 myapp(如这一行所示):

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

关于android - 错误 : Error parsing XML: unbound prefix in admob,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14219591/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com