28

Possible Duplicate:
Admob Error in Eclipse for android:configChanges

I want to display AdMob's ads in my android application. I do all the necessary like in the doc. But I can't run my app because there is an error on my AndroidManifest.xml on this line :

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

The error is :

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

But if I delete some value my app is running but instead of the ads I've this text : "You must have AdActivity declared in AndroidManifest.xml with configChanges."

I don't unterstand how I can fix the problem.

I'm using android SDK 2.1 and the last google adMob SDK 4.3.1

Thanks

Community
  • 1
  • 1
guillaume
  • 1,638
  • 5
  • 24
  • 43

2 Answers2

50

To fix the problem you have to set your project build target to Android 3.2 or higher, see the requirements section in the documentation (Android tab).

Tomik
  • 23,857
  • 8
  • 121
  • 100
  • 1
    I don't understand because in the properties in Project Build Target it's Android 2.1 that is checked. If I build my project with Android 3.2 or higher my application won't be accessible on Android 2.1 – guillaume Oct 26 '11 at 13:02
  • 19
    No, that's not correct. You are compiling your app against the version in build target, so that you app can (but don't have to) use all the new APIs there. But you can still run your app on devices running older versions of Android. You can specify the minimal version of Android OS capable to run your app in uses-sdk manifest tag (if it is not specified, the minSdkVersion is 1). – Tomik Oct 26 '11 at 13:20
  • 2
    Thanks, I understand better the link between the SDK used and the minSdkVersion :) – guillaume Oct 26 '11 at 13:54
  • one other note, you have to be sure that the 'uses-sdk' node is placed prior to the 'application' node, or else you'll also get this error even once you've changed your build target – Joel Martinez Mar 28 '12 at 21:03
  • @Tomik : I have specified minimu sdk as 13 as you have said in the manifest file. But when I try to run the app in my 2.3 android phone. It says "Application requires Api 14. Device Api is 10 (Android 2.3)" – Ashwin Sep 27 '12 at 16:26
  • Check [android:minSdkVersion](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html) attribute in your manifest. It seems you set it to 14, to run your app on Android 2.3 set it to 10 or lower. – Tomik Sep 27 '12 at 19:29
  • @Tomik i too faced the same problem. i have set the build target to android 4.0 and in the manifest file if i specify minsdkversion less than 9 or 10. It works fine but i am unable to upload it to market and i am getting the unable to process the apk file error. I faced this issue and after changed hte sdkversion to 14 it worked but still i want to set sdkversion to 10. Can you please let me know how to do it. Please i need you peoples help now... – Dinash Dec 23 '12 at 05:22
  • I suggest you should post it as a new question. Comments are not the right place for it. – Tomik Dec 23 '12 at 13:38
7

You can also just ignore the newer configchanges setting and make it like the old version has:

configChanges="keyboard|keyboardHidden|orientation"

This is what I always had in my admob ad activity. The new stuff is propably for android 3+.

Peterdk
  • 15,625
  • 20
  • 101
  • 140
  • 4
    Hm, this hasn't worked for me. The black banner with the red border occured when setting this. For me the only working solution was to change the build target. – sven Oct 31 '11 at 07:51
  • 4
    Yeah that doesn't work unless you use an older version of the admob jar lib – Blundell Nov 06 '11 at 14:31
  • This doesn't work for new admob jar. It worked for previuos versions. – Jay Mayu Feb 25 '12 at 16:56