Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AdMob error "you must have adactivity declared in androidmanifest.xml with configchanges"

I'm trying to get AdMob in my android-app. When i launch the emulator it says:

"you must have adactivity declared in androidmanifest.xml with configchanges"

There are a lot of topics about this but no one fixt the issue.

Please help me out!

Greetz, Jasper....

like image 407
Jasper Meijrink Avatar asked Sep 15 '12 13:09

Jasper Meijrink


4 Answers

A proper Admob Activity in your AndroidManifest definition looks like this:

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

You are probably missing the android:configChanges part.

Note that all the configChanges parameters are required. Since not all of them exist/are allowed in older SDKS, you need to use a more recent Android version as your default build platform. You will still be able to target older Android versions if you set your minSdk properly and do not use any newer API calls in your code though.

like image 91
Integrating Stuff Avatar answered Nov 02 '22 17:11

Integrating Stuff


What worked for me was to change the Android SDK version to 13 and expand the android:configChanges in the manifest to contain all parameters:

android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"

NOTE: The configChanges content is case-sensitive so make sure you preserve camelCase! (This bit me in the beginning)

I started receiving ad's within a minute or so.

like image 43
kenj Avatar answered Nov 02 '22 18:11

kenj


a very good tutorial, here : http://jmsliu.com/209/add-google-admob-in-android-application.html

like image 2
user785975 Avatar answered Nov 02 '22 19:11

user785975


Set your Build Target to latest you have (>=4) it will work. You can still have minSdkVersion, targetSdkVersion as you like.

The ad will appear after a while, be patient :)

like image 1
AVEbrahimi Avatar answered Nov 02 '22 17:11

AVEbrahimi