【问题标题】:Error string types not allowed at android:configChanges in manifest file清单文件中的 android:configChanges 不允许出现错误字符串类型
【发布时间】:2012-06-26 13:45:53
【问题描述】:

这是我的清单文件,其中显示了 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>

【问题讨论】:

标签: android


【解决方案1】:
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"

screenSize & smallestScreenSize 属性在 SDK 10 中不可用。它们是在 API 级别 13 中引入的。

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

【讨论】:

  • IE,将项目目标更改为 API 级别 13 或以上。
  • Project > Properties > Android > Change 'Project Build Target' to above 3.2.
  • 但是...这意味着我的应用程序无法在 Gingerbread 中运行,对吧?:-(
  • 这并不意味着您将失去与姜饼 @Yavierre 的兼容性。 Target SDK 只是在您的代码上运行的编译器。 “最低 SDK 级别”是您的应用兼容的最远级别。
【解决方案2】:
  • 确保您拥有最新的 Android SDK 副本并且您是 至少针对 Android v3.2 进行编译(将目标设置为 project.properties 到 android-13)。
  • 适用于 Android 的 Google 移动广告 SDK 需要 Android 2.3 或更高版本的运行时(设置 android:minSdkVersion 在您的 AndroidManifest.xml 中至少设置为 9)。 这意味着您可以使用最新版本的 Android SDK 进行开发 并且您的应用仍将在较早的 Android 版本(2.3 最低)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-16
    • 1970-01-01
    • 2017-04-03
    • 1970-01-01
    相关资源
    最近更新 更多