添加Admob的code到Android给错误:你必须在AndroidManifest.xml中AdActivity声明 [英] Adding Admob code to Android giving error: You must have AdActivity declared in AndroidManifest.xml

查看:223
本文介绍了添加Admob的code到Android给错误:你必须在AndroidManifest.xml中AdActivity声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现我与Admob的第一个广告。我读过,这似乎是有帮助的,以及这个其他职位: <一href="http://stackoverflow.com/questions/7902121/admob-cant-display-ads-because-of-configchanges">AdMob无法显示,因为configChanges 广告

所以,我给自己定的项目构建目标到Android 4.0(API 14)。我还添加这是project.properties。

 #项目的目标。
目标=机器人-14
 

然后,我已经包括在AndroidManifest.xml中这些行:

 &LT;活动机器人:名称=com.google.ads.AdActivity
           android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
 

我也加入到所需的code,以显示我的活动类广告。 (喜欢这里descirbed: HTTP:/ /$c$c.google.com/intl/de-DE/mobile/ads/docs/android/fundamentals.html

现在的问题是,当我运行此code,广告空间表现,但与该说,只有消息:

 你必须有AdActivity在AndroidManifest.xml中宣布与configChanges。
 

同样的事情被打印在logcat中。

我是不是忽略了一些东西呢?任何人都可以有一点我一些其他的方式?

解决方案

我不知道我做了什么。但是,我下载并安装Android的SDK 3.2为好。此外还对ARM EABI V7A(仿真器)的安装。

突然,它现在同时适用于Android的SDK 4.0和3.2。另外关于这个话题的好职位: Admob的错误和SDK混乱

编辑:这似乎是符合了Admob的要求,并给它时间,解决了这个错误我。

I'm trying to implement my first ads with Admob. I've read the other posts that seems to be helpful, as well as this: AdMob can't display ads because of configChanges

So I've set the project build target to Android 4.0 (API 14). I've also added this is the project.properties.

# Project target.
target=android-14

Then I've included these lines in AndroidManifest.xml:

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

I've also added to required code to display the ad in my activity class. (Like descirbed here: http://code.google.com/intl/de-DE/mobile/ads/docs/android/fundamentals.html)

The problem is that when I run this code, the ad space is showed but with only message that says:

 "You must have AdActivity declared in AndroidManifest.xml with configChanges". 

The same thing is printed out on the logcat.

Am I ignoring something here? Could anyone with point me some other way?

解决方案

I'm not sure what I did. But I downloaded and installed Android SDK 3.2 as well. In addition also the ARM EABI v7a (for the emulator) was installed.

Suddenly it now works for both Android SDK 4.0 and 3.2. Also a good post about this topic: Admob error and sdk confusion

EDIT: It seems like complying with the requirements for the Admob and giving it time, solves this error for me.

这篇关于添加Admob的code到Android给错误:你必须在AndroidManifest.xml中AdActivity声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆