Reputation: 47
<?xml version="1.0" encoding="UTF-8"?>
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
package="com.app">
<com.admob.android.ads.AdView
android:id="@+id/MainActivity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-"
android:name="com.admob.android.ads.AdView"/>
<com.admob.android.ads.AdView/>
</RelativeLayout>
code for my adview XML file
error: unbound prefix.
xmlns:android="http://schemas.android.com/apk/res/android"
Upvotes: 0
Views: 73
Reputation: 454
Since you are trying to integrate AdMob, try to change:
xmlns:ads="http://schemas.android.com/apk/res-auto"
To this:
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
Also, you have a closing tag for a RelativeLayout that was never opened.
Upvotes: 1