0

I tried to add a admob banner to my app but i'm getting a problem in the android manifest. The next code seems to be the problem:

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

The configChanges without the flags screenSize and smallestScreenSize gives me no error in the code but where the banner stands i get the message that the configChanges are missing. With these flags i'm getting the error: String type not allowed. So it look likes the manifest is not recognizing this flags.

This is my android manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.company"
      android:versionCode="1" android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name"
           android:debuggable="true">
<activity android:label="@string/app_name" android:name="BannerExample">
  <intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
  </intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
           android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>

I hope there is a solution for this.

Joeri Jacobs
  • 15
  • 1
  • 5
  • See: http://stackoverflow.com/questions/7899767/admob-error-in-eclipse-for-androidconfigchanges – nEx.Software Jul 06 '12 at 14:12
  • I see that it is working for 3.2 but i have 2.3.3. Is it not working then on my version? – Joeri Jacobs Jul 06 '12 at 14:55
  • You just need to target a later version (in order to use those flags) and it will compile. On earlier versions those flags will be ignored. – nEx.Software Jul 06 '12 at 15:01
  • So on 2.3.3 it is not working then? So any android device with 2.3.3 can not view ads? – Joeri Jacobs Jul 06 '12 at 15:08
  • No, you only need to target a higher version at compile time. You can set your minSdkVersion in your manifest to any api level you want. As an example, adding `` indicates you want to support 2.2+ but you are targeting 4.1. This will get it to compile. Ads will be viewable on all versions. – nEx.Software Jul 06 '12 at 15:25

0 Answers0