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

查看:25
本文介绍了Eclipse 中针对 android:configChanges 的 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 Manager 中安装了 SDK Platform Android 4.0 - Revision 14.

and in my SDK Manager having the SDK Platform Android 4.0 - Revision 14 installed.

它也应该适用于 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.

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

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