Felix D.
Felix D.

Reputation: 5103

Xamarin.Forms AdMob "Missing AdActivity"

I have a problem implementing AdMob in my Xamarin.Forms project.

So when I run the android app this is shown in the output:

01-22 16:53:17.351 W/Ads (3529): Missing AdActivity with android:configChanges in AndroidManifest.xml. 
You must have the following declaration within the <application> element:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

But my Manifest got this line in it..:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
    <uses-sdk android:minSdkVersion="15" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

And when I open the page containing the ad this is showing:

enter image description here

What is wrong here ?

Upvotes: 3

Views: 313

Answers (1)

Sujay
Sujay

Reputation: 3455

<activity> tag should be inside the <application> tag

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

Upvotes: 5

Related Questions