清单文件中的 android:configChanges 不允许错误字符串类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11208729/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error string types not allowed at android:configChanges in manifest file
提问by Farman Khan
Here is my manifest file which shows error string types not allowed at android:configChanges please help me in rectification of the error. below is my manifest file.
这是我的清单文件,它显示了 android:configChanges 不允许的错误字符串类型,请帮助我纠正错误。下面是我的清单文件。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ifahja.banner"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MyBannerActivity"
android:label="@string/app_name" >
<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|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
回答by Vipul Shah
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
screenSize
& smallestScreenSize
attributes are not available in SDK 10.They are been introduced in API level 13.
screenSize
&smallestScreenSize
属性在 SDK 10 中不可用。它们是在 API 级别 13 中引入的。
http://developer.android.com/guide/topics/manifest/activity-element.html#config
http://developer.android.com/guide/topics/manifest/activity-element.html#config
回答by Ameya Pandilwar
- 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 project.properties to android-13).
- The Google Mobile Ads SDK for Android requires a run-time of Android 2.3 or later (set android:minSdkVersion to at least 9 in your AndroidManifest.xml). This means you can develop with the latest version of the Android SDK and your app will still run on an earlier Android version (2.3 minimum).
- 确保您拥有最新的 Android SDK 副本,并且至少针对 Android v3.2 进行编译(将 project.properties 中的目标设置为 android-13)。
- 适用于 Android 的 Google 移动广告 SDK 要求运行时为 Android 2.3 或更高版本(在 AndroidManifest.xml 中将 android:minSdkVersion 设置为至少 9)。这意味着您可以使用最新版本的 Android SDK 进行开发,并且您的应用程序仍将在较早的 Android 版本(最低 2.3)上运行。