Problems getting adMob setup
I h开发者_StackOverflow社区ave a very basic android activity with just the following xml code, and permissions to access internet/network state in my manifest, but im still getting the following error:
09-20 15:58:00.896: WARN/Ads(748): Invalid adSize parameter in XML layout: -1. Defaulting to BANNER. 09-20 15:58:00.906: ERROR/Ads(748): AdView missing required XML attribute adUnitId.
heres my xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="a14e7524ca3db03"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
Take a look at my question a while ago: AdMob: Missing required XML attribute adUnitID
I found out that the correct line should be:
xmlns:ads="http://schemas.android.com/apk/res/com.niek.runningapp"
So try something similar for your app.
精彩评论