AdMob的SDK 4.3.1 - 我不能显示横幅横幅、AdMob、SDK

2023-09-06 06:41:58 作者:现在的人讲究个性

我遵循AdMob的教程中的所有步骤,但是当我运行我的应用程序,而不是打着有你必须有AdActivity在AndroidManifest.xml中宣布与configChanges

I have follow all the steps on AdMob tutorial, but when I run my application instead the banner there is "You must have AdActivity declared in AndroidManifest.xml with configChanges"

我的Andr​​oidManifest是:

My AndroidManifest is :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="it.gmg.android.fpg"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" />

<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" >

<activity android:label="@string/app_name" android:name=".FPGActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

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

</application>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>


</manifest>

我觉得一切都是正确的,我为什么不能显示横幅广告吗?

I think all is correct, why I cant display the banner?

最好的问候

推荐答案

您丢失了Admob的的 configChanges 属性某些条目 AdActivity - 看到谷歌的描述的此处。这也可能会导致你改变你的构建目标。阅读我详细的解答的相关quetsion Admob的执行错误。

You are missing some entries in the configChanges attribute of the Admob AdActivity -- see Google's description here. This may also cause you to change your build target. Read my detailed answer to the related quetsion Admob implementation Error.