user3202845
user3202845

Reputation: 41

Error parsing XML: unbound prefix Admob

I got a problem in my layout where Im trying to add the Admob.

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads ="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:tools="http://schemas.android.com/tools" 

android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/lined2"
tools:context=".MainActivity" >

    <com.google.ads.AdView
    android:id ="@+id/adview"
    android:layout_width="fillparent"
    android:layout_height="wrap_content"
    ads:adUnitId="My ID"
    ad:adSize="BANNER"
    ads:testdevices="TEST_EMULATOR"
    ads:loadAdOnCreate="true" />

So the Error is in this line :

 <com.google.ads.AdView

It says :

Error parsing XML:unbound prefix 

I really searched many Posts but no one helped me... I allready add the line with add xmlns:ads .... but It doesnt help :/ Did I forgot sth. ?

Thank you for your help !

Upvotes: 1

Views: 1373

Answers (2)

Sanjeev
Sanjeev

Reputation: 9946

<com.google.ads.AdView
android:id ="@+id/adview"
android:layout_width="fillparent"
android:layout_height="wrap_content"
ads:adUnitId="My ID"
**ads:adSize="BANNER"**
ads:testdevices="TEST_EMULATOR"
ads:loadAdOnCreate="true" />

correction.

Upvotes: 1

Szymon
Szymon

Reputation: 43023

You missed s in the namespace for adSize.

Change

ad:adSize="BANNER"

to

ads:adSize="BANNER"

Upvotes: 1

Related Questions