AdMob SDK 4.3.1-我无法显示横幅广告[英] AdMob SDK 4.3.1 - I can't display banner

本文是小编为大家收集整理的关于AdMob SDK 4.3.1-我无法显示横幅广告的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我已经遵循Admob教程的所有步骤,但是当我运行我的应用程序而不是横幅时,"您必须在Androidmanifest.xml中用ConfigChanges"

中的androidmanifest.xml中声明的adactivity

我的androidmanifest是:

<?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>

我认为一切都是正确的,为什么我无法展示横幅?

最好的问候

推荐答案

您缺少ADMOB AdActivity的configChanges属性中的一些条目 - 请参阅Google的描述这里.这也可能导致您更改构建目标.阅读我的详细答案驱动程序实现错误

本文地址:https://www.itbaoku.cn/post/102666.html

问题描述

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"

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?

Best regards

推荐答案

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.