1
votes

I'm trying to add admob into my app but i'm not having much luck.

I'm following the examples in the tutorial and using the XML method to create the banner. Everything seems to work fine and compile without error except for 1 part... (when I try to declare the activity in the manifest.)

Here is the entry i'm attempting:

<activity android:name="com.google.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

and here is the error i'm getting:

error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').

In addition to this, if I attempt a clean and build with this entry present in the manifest, the R.file disappears and won't come back. I'm puzzled. I'm not very knowledgeable yet but i'm wondering if this error has something to do with an outdated syntax. The entry is copied word for word, but eclipse seems to be saying it doesn't know how to read it? Thoughts?

1

1 Answers

3
votes

The newest AdMob jar requires being build against the 13 SDK. I added this to the manifest

    <uses-sdk
    android:maxSdkVersion="13"
    android:minSdkVersion="8"
    android:targetSdkVersion="13" />

You'll get a warning in the manifest that the minSdkVersion is less than the targetSdkVersion, but I haven't seen that cause any issues.

You also need to change the line in default.properties or project.properties to

target=android-13

Hope this helps.