I am trying to put ads into my Android application, but I’m getting a weird error.
My app launches with this in the Manifest file. But it shows an error in the emulator saying
“You must have AdActivity declared in the AndroidManifest.xml with configChanges.”
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboardHidden|orientation|keyboard"/>
Whenever I add this to the Manifest file I cannot compile.
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
The easiest part at first: you are missing a few flags in the configChanges attribute of the definition of the AdActivity in your AndroidManifest.xml. As shown in the AdMob SDK Docs the definition needs to look like this:
The second —
Investigated the reason is because these three attributes in the latest SDK (> = 13) support, the project properties are set with Android2.2 solution is as follows:
a: Upgrade ADT to download the latest SDK
b: the API to modify the Project Build Target Level, its value must be> = 13, I chose to Android 4.0. Modify these steps: Right-click on the item, and select Properties -> Android -> Android 4.0
c: Modify the the AndroidManifest.xml of the targetSdkVersion and minSdkVersion value is the value of their own needs
for more help see