android:configChanges Eclipse 中的 Admob 错误 [英] Admob Error in Eclipse for android:configChanges

查看:28
本文介绍了android:configChanges Eclipse 中的 Admob 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse 在我的 AndroidManifest.xml 中的 android:configChanges 行给我一个错误:

Eclipse is giving me an error on the android:configChanges line in my AndroidManifest.xml:

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

错误是:

error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').

如果我只留下 keyboard|keyboardHidden|orientation 没有错误,但是当我尝试构建时编译器会要求剩下 4 个.

If I leave only keyboard|keyboardHidden|orientation there's no error, but compiler asks for the 4 remaining ones when I try and build.

我使用的是 GoogleAdMobAdsSDK-4.3.1.

有什么想法吗?

我通过将我的 project.properties(SDK 低于 14 的default.properties)文件更改为:

I got it working by changing my project.properties (default.properties on SDK's lower then 14) file to:

# Project target.
target=android-14

在我的 SDK 管理器中安装了 SDK 平台 Android 4.0 - 修订版 14.

它也应该适用于 SDK Platform android 3.2 - 修订版 13,因此如果是这种情况,您只需将 project.properties 目标更改为 android-13.基本上,您只需要确保 SDK 版本为 13 或更高版本,并且您在 SDK 管理器中安装了该 SDK,并且 default/project.properties 中的项目目标指向它.

It should also work for SDK Platform android 3.2 - revision 13, so you just have to change the project.properties target to android-13 if that is the case. Basically you just have to make sure that the SDK revision is 13 or above, and that you have that SDK installed in the SDK manager and the project target in default/project.properties pointing to it.

推荐答案

简单回答:Android 2.1 不支持上述配置更改,请看这里:

Simple answer: the mentioned config changes are not support in Android 2.1, have a look here:

http://developer.android.com/guide/topics/manifest/activity-element.html#config

例如uiMode 需要 API 级别 8.

e.g. uiMode needs API Level 8.

来自官方 AdMob 文档:

From the official AdMob Documentation:

要求

Android 版 Google AdMob 广告 SDK 需要 Android 1.5 或更高版本.确保您拥有最新的 Android SDK 副本,并且至少针对 Android v3.2 进行编译(将 default.properties 中的目标设置为 android-13).

The Google AdMob Ads SDK for Android requires Android 1.5 or later. Make sure you have the latest copy of the Android SDK and that you're compiling against at least Android v3.2 (set target in default.properties to android-13).

看看这里:https://developers.google.com/admob/安卓/快速启动

所以我认为你的工具版本至少没有更新到版本 13.

So I think your tools version is not updated to at least Version 13.

这篇关于android:configChanges Eclipse 中的 Admob 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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