缺少adActivity与Android:configChanges在AndroidManifest.xml中Android、adActivity、configChanges、xml

2023-09-08 15:52:14 作者:凉心

我想AdMob广告横幅我的应用程序,但这样做的谷歌文档的所有步骤后,不幸的是我仍然收到此警告在logcat中找不到 com.google.android.gms。 ads.adactivity ,这一消息在AdMob的旗帜缺少adActivity与安卓configChanges 在AndroidManifest.xml中虽然我加了安卓configChanges 在AndroidManifest.xml中

I am trying to an admob banner to my application but unfortunately after doing all the steps of the Google documentation I still receive this warning in the logcat "could not find com.google.android.gms.ads.adactivity" and this message in the banner of the admob "Missing adActivity with Android: configChanges in AndroidManifest.xml" ALTHOUGH I added the Android: configChanges in AndroidManifest.xml

这是我的manifest.xml

here is my manifest.xml

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

我真的需要你的帮助。

I really need your help

推荐答案

com.google.ads.AdActivity使用中的库文件夹中的AdMob的SDK罐子时宣布。看来您是通过谷歌播放服务库使用的AdMob这样改变:

"com.google.ads.AdActivity" is declared when using the admob sdk jar in the "libs" folder. It seems you're using admob via the google play services library so change:

活动的android:NAME =com.google.ads.AdActivity

activity android:name="com.google.ads.AdActivity"

活动的android:NAME =com.google.android.gms.ads.AdActivity

activity android:name="com.google.android.gms.ads.AdActivity"

另外,还要确保你添加元数据标记:

Also make sure you add the meta-data tag:

<meta-data android:name="com.google.android.gms.version"
           android:value="@integer/google_play_services_version"/>