简体   繁体   English

Xamarin.Forms AdMob“缺少AdActivity”

[英]Xamarin.Forms AdMob “Missing AdActivity”

I have a problem implementing AdMob in my Xamarin.Forms project. 我在Xamarin.Forms项目中实现AdMob时遇到问题。

So when I run the android app this is shown in the output: 因此,当我运行Android应用程序时,它显示在输出中:

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有这条线...:

<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: 当我打开包含广告的页面时,显示:

在此输入图像描述

What is wrong here ? 这有什么不对?

<activity> tag should be inside the <application> tag <activity>标签应位于<application>标签内

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM