0

Im trying to put an admob on one of my activities and i did everything instructed and I keep getting this error when i run the code "You must have AdActivity declared in AndroidManifest.xml with configChanges, when i use all the code i get a build error..(I have all the permissions needed declared as well)

Here is my android manifest code for the ad:

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

Here is my xml code for the activity i want it displayed on:

    <com.google.ads.AdView
   android:layout_gravity=""
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adUnitId="MY_PRIVATE_ID"
    ads:loadAdOnCreate="true"
    ads:adSize = "BANNER" />

Can someone give me a clear and simple answer as to what I need to do in order to get this running, I also downloaded android 3.2, but I dont know how to configure in the build path of my existng android 2.3 project

2 Answers2

1

I think it depends on which version of the jar file you are using.

For GoogleAdMobAdsSdk-4.1.1.jar try

android:configChanges= "keyboard|keyboardHidden|orientation"

and for GoogleAdMobAdsSdk-4.1.3.jar try

android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
AG1
  • 6,648
  • 8
  • 40
  • 57
  • i know, when im using 4.1.3 jar.. i dont know how to get the 4.1.1 jar, and when i use the bottom code you have for 4.3.1 i get a build error unless i project.properties to 13, but the the whole project gets an error even if i clean it.. – Kevin Hagens Mar 07 '12 at 17:58
0

I would take a look at a previous answer. There's an awesome explanation given there.

Community
  • 1
  • 1
RajPara
  • 2,281
  • 1
  • 16
  • 9