【问题标题】:"ERROR getting 'android:icon' attribute: attribute is not a string value" when trying to upload to the Android Market尝试上传到 Android Market 时出现“获取 'android:icon' 属性时出错:属性不是字符串值”
【发布时间】:2016-11-01 06:16:33
【问题描述】:

这里没有类似的问题,但谷歌搜索其他一些人也遇到了同样的问题。推荐的修复方法均无效。

完整的错误是:

文件无效:W/ResourceType(32055):获取条目失败 0x7f050001 (t=4 e=1) in package 0 (error -75) ERROR getting 'android:icon' 属性不是字符串值

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.dominoes"
      android:versionCode="10"
      android:versionName="2.00">
    <application android:icon="@drawable/myicon" android:label="@string/app_name">
        <activity android:name=".Dominoes"
                  android:screenOrientation="landscape"
                  android:configChanges="orientation|keyboardHidden" 
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
        <uses-sdk android:minSdkVersion="3" 
            android:targetSdkVersion="4" />
            <supports-screens
          android:largeScreens="true"
          android:normalScreens="true"
          android:smallScreens="true"
          android:anyDensity="false" />  
</manifest> 

图像“myicon.png”位于 res/drawable 文件夹中。这是一个 96x96 的 .png。

【问题讨论】:

    标签: android icons android-manifest google-play


    【解决方案1】:

    好吧,在解决这个愚蠢的错误几个小时之后,我自己找到了答案。这是我为数不多的已本地化为西班牙语的应用程序之一,因此我的 res 目录具有以下内容:

    res/values-zh

    res/values-es

    这显然在以前版本的 Android 电子市场中运行良好。我想我最后一次更新这个应用程序是一年多以前了。

    不管怎样,结果我只需要一个简单的值目录:

    分辨率/值

    res/values-zh

    res/values-es

    我刚刚将 values-en 目录的内容复制到 values 目录中,现在 Android 市场很高兴,让我上传我的 .apk。我在遇到的任何研究中都没有看到这个特定的答案,所以希望这对某人有所帮助。

    【讨论】:

    • 您可以接受自己的答案,这将有助于以后的其他人
    • 上传时的另一个常见问题是您确实有 values 文件夹,但默认 strings.xml 文件中缺少一些文字,而这些文字存在于翻译中。我还在错误消息中看到了“android:icon”和“android:label”。
    【解决方案2】:

    您必须将使用的图标放在主要的可绘制文件夹中。您不必从其他文件夹中删除图标,为它们保留不同大小的图标,但至少将其中一个放在 drawable 中。

    【讨论】:

      【解决方案3】:

      在我的例子中,我将 icon.png 放到所有可绘制文件夹(xdpi mdpi 和其他)。 为了解决这个问题,我从可绘制文件夹(xdpi mdpi 和其他)中删除了所有图标,并将一个 96x96 的图标放入可绘制文件夹并解决了问题。

      【讨论】:

        【解决方案4】:

        使用最新的 Play 商店要求,您可能需要将 AndroidManifest.xml 文件中的 android:icon drawable 放入“drawable”文件夹或“drawable-nodpi”文件夹中(如果您只将它放在与存储桶相关的文件夹中,例如“ drawable-large-land”或其他指定存储桶相关资源的文件夹。

        就我而言,我只是将用于应用图标的资源复制到“drawable-nodpi”文件夹中,Play 商店接受了我的 apk。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-08-18
          • 1970-01-01
          • 1970-01-01
          • 2015-02-09
          • 2016-08-13
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多