Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android XML Error parsing XML unbound prefix [closed]

I had 2 errors but i got one fixed. I still have the Error parsing XML unbound prefix error thou at the com.admob.android.ads wats wrong?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" 
/>

<com.admob.android.ads.AdView
  android:id="@+id/ad" 
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content"
  xmlns:backgroundColor="#000000"
  xmlns:primaryTextColor="FFFFFF"
  xmlns:secondaryTextColor="#CCCCCC"
  android:layout_alignParentTop="true"
  ads:adUnitId="xxxxxxxxxxxx"
  ads:adSize="BANNER"
  ads:loadAdOnCreate="true"
  /> 
</RelativeLayout>     
like image 562
badmanthe5 Avatar asked Nov 30 '25 02:11

badmanthe5


1 Answers

You need to set layout configuration on the main tag (RelativeLayout) and to set the namespace of ads:

<RelativeLayout
    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"
>      
like image 87
onof Avatar answered Dec 02 '25 15:12

onof