Kishor datta gupta
Kishor datta gupta

Reputation: 1103

error: Error parsing XML: unbound prefix in admob

I tried many combination but it showing following error in xml file

error: Error parsing XML: unbound prefix

in <com.google.ads.AdView line, how can i resolve this.

   <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>

Upvotes: 1

Views: 4172

Answers (1)

karllindmark
karllindmark

Reputation: 6071

I'd like to think that you should be using the ads: instead of myapp:, but I might be wrong. Let me know if this doesn't work for you:

<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"
     />

The reason for this possibly helping would be the fact that you've set an ads namespace, but not myapp (as seen in this line):

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

Upvotes: 13

Related Questions