I am working on an Android app and trying to implement Admob advertisement sdk. I have done everything that have been mentioned in the documentation but I am getting following error in red color in the black window which should have displayed advertisement.
You must have AdActivity declared in AndroidManifest.xml with ConfigChanges
I have added following line in AndroidManifest.xml:
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" />
I have tried but still I am not able to resolve this error. I am trying to run the application in my Xperia phone which has Android 4.0.4.
You need to put this in your manifest:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
AdViews handle a lot of configuration changes themselves. The official documentation can be found here.
According to unify, Admob is now integrated into Google Play Services. A migration reference can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With