2
votes

I am trying to integrate AdMob and I have come to the point where I have to add this line to my manifest and I keep getting this error. This is the exemplar from this link http://code.google.com/mobile/ads/docs/android/fundamentals.html

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

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

4

4 Answers

7
votes

You must build against API 13 (Android 3.2). You will leave the android:minSdkVersion the same in your Manifest, but you will have to build against 3.2.

In Eclipse(I assume?), right click on the project > Properties > Android (on the left) > then choose 3.2 and click 'OK'.

This will not cause problems - your app will still run fine on older devices. But do be careful and make sure you don't use new code for old devices.

What I generally do to make this easy is before exporting to publish I switch the target back to my minimum, make sure there are no compile errors, then I switch it back to 3.2 - just a tip.

1
votes

I use the following in my manifest. The target Android SDK is Version 8. Using AdMob SDK 4.1.1.

<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboardHidden|orientation|keyboard"/>
0
votes

Here after playing around with it I found the right combination apparently adMob requires a few settings. I am building using the 3.2 SDK but I have tested this and it runs on 2.3.3 just for FYI.

AndroidManifest.xml

<uses-sdk 
    android:minSdkVersion="10" 
    android:maxSdkVersion="16" 
    android:targetSdkVersion="13"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

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

Then my default.properties must have

target=android-10

Also the project.properties had to have

target=android-13

Then add your <com.google.ads.AdView .../> to your XML layout or call it from code and you should be in business.

0
votes

you can ignore the latest changes, and use the older one instead

configChanges="keyboard|keyboardHidden|orientation"