得到 "'android:icon' 属性:将 APK 上传到 Play 商店时出现“属性不是字符串值"错误 [英] getting " 'android:icon' attribute: attribute is not a string value” error while uploading an APK to the play store

查看:34
本文介绍了得到 "'android:icon' 属性:将 APK 上传到 Play 商店时出现“属性不是字符串值"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

经过这么多小时的空闲时间,我准备将我的第一个应用发布到 Play 商店,但遗憾的是我在上传已签名的应用时遇到了困难.

我已经使用我创建的密钥库成功导出了应用程序(全部通过 Eclipse 和 ADT),所以我将签名的 APK 上传到 Play 商店(.

我的尝试

我在 StackOverflow 上搜索过,发现了很多关于它的帖子(此处).我已经阅读了很多并尝试了接下来的事情,但没有任何帮助:

  1. 将应用程序图标放在不同的文件夹/s(drawable",drawable-mdpi",......甚至drawable-xxxhdpi")上,并具有多种组合(从每个文件夹中放置/删除).

  2. 在应用程序"标签和启动器活动标签上设置标签、图标和主题.

  3. 更改图像文件名和文件本身(将其替换为默认应用图标).

  4. 清理项目.

  5. 检查 Lint 消息.

  6. 更新 ADT(至 22.3.0.v201310242005-887826)、Eclipse(至 Kepler Service Release 1)、SDK 工具(至 22.3)、SDK 构建工具(至 19.0.1).一切都是最新的官方版本.

  7. 检查没有使用双 jar 文件(多个库中不存在 jar 文件,尤其是如果它有不同的版本).

  8. 尝试将 strings.xml 放入res/values-en"而不是res/values"

  9. 尝试将android:value"属性添加到清单上的所有元数据标签(由 Google 建议).它没有用.事实上,在我读过的所有教程中,我从未看到 AppWidget 有这样的要求,所以我认为无论如何都不需要.

  10. 尝试了 aapt 命令:

    aapt 转储标记

这向我展示了与 Play 商店显示的相同的内容(我在此处用 XXX 替换了真实的包名称和应用名称):

<块引用>

application: label='XXX XXX' icon='res/drawable-mdpi/app_icon.png'launchable-activity: name='XXX.XXX.XXXActivity' label='XXX XXX' icon='res/drawable-mdpi/app_icon.png'W/ResourceType(9132):获取资源编号 0 的值时没有已知包x01080049错误获取android:icon"属性:属性不是字符串值

即使此文件夹中确实存在该文件,也会发生这种情况.

这是清单.同样,用 XXX 替换活动和应用程序的真实路径和名称.我可以向您保证路径是正确的,因为应用程序可以正常运行.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"包=XXX.XXX"机器人:安装位置=自动"机器人:版本代码=2"android:versionName="1.0" ><使用-sdkandroid:minSdkVersion="9"android:targetSdkVersion="19"/><支持屏幕机器人:anyDensity =真"机器人:大屏幕=真"机器人:正常屏幕=真"机器人:smallScreens =真"android:xlargeScreens="true"/><使用权限 android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/><使用权限 android:name="android.permission.KILL_BACKGROUND_PROCESSES"/><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.ACCESS_SUPERUSER"/><!-- admob 需要:--><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.INTERNET"/><!-- 需要应用内结算.--><uses-permission android:name="com.android.vending.BILLING"/><!-- 需要应用内计费的有效载荷--><uses-permission android:name="android.permission.GET_ACCOUNTS"/><申请机器人:名称=XXX.XXX.XXX"机器人:allowBackup =真"android:description="@string/app_description"安卓:硬件加速=真"android:icon="@drawable/app_icon"android:label="@string/app_name"android:theme="@style/AppTheme" ><活动android:name="XXX.XXXActivity"机器人:clearTaskOnLaunch =真"android:configChanges="keyboard|keyboardHidden|方向|screenLayout|uiMode|screenSize|最小屏幕尺寸"android:finishOnTaskLaunch="true"android:icon="@drawable/app_icon"机器人:标签=@字符串/XXX"android:launchMode="singleTask"android:screenOrientation="fullSensor" ><意图过滤器><action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.LAUNCHER"/></意图过滤器></活动>...(其他活动和服务)

问题

这是怎么回事?

我该如何克服这个问题?

解决方案

如果您使用任何 android 系统图标作为活动图标(即清单包含 <activity ... android:icon="@android:drawable/... ) ,它们可能是问题所在.如果是,请尝试将这些图标复制到您的项目中.在其他地方使用它们应该没问题,因为标记不会触及这些.

Background

After so many hours of my free time, I'm ready to publish my very first app to the play store, but sadly I'm having difficulties uploading the signed app.

I've successfully exported the app with the keystore I've created (all via Eclipse & ADT), so I have the signed APK to be uploaded to the play store (here).

The problem

I keep getting this message:

Upload failed Your APK cannot be analyzed using 'aapt dump badging'. Error output: Failed to run aapt dump badging: W/ResourceType(14856): No known package when getting value for resource number 0x01080049 ERROR getting 'android:icon' attribute: attribute is not a string value

as such:

The app itself works very well on real devices, and the image file being used is a normal PNG file as used by the android-assets-studio website.

What I've tried

I've searched here on StackOverflow and found many posts about it (here). I've read many of them and tried the next things, but nothing has helped:

  1. put the app icon on a different folder/s ("drawable", "drawable-mdpi", ... even "drawable-xxxhdpi") with multiple combinations (put/remove from each of the folders).

  2. setting the label, icon and theme on both the "application" tag and on the launcher activity tag.

  3. change the image file name and the file itself (replaced it with the default app icons).

  4. clean up the project.

  5. Checking Lint messages.

  6. updating ADT (to 22.3.0.v201310242005-887826), Eclipse (to Kepler Service Release 1), SDK tools (to 22.3), SDK build tools (to 19.0.1). Everything is pretty much the latest official version.

  7. checking that there's no double jar file being used (that no jar file exists on more than one library, especially if it has different versions).

  8. tried putting the strings.xml into "res/values-en" instead of "res/values"

  9. tried adding "android:value" attribute to all meta-data tags on the manifest (suggested by Google). It didn't work. In fact, in all of the tutorials I've read, I never saw such a requirement from an AppWidget, so I think it's not needed anyway.

  10. tried the aapt command:

    aapt dump badging
    

This has shown me about the same thing the play store shows (I've replaced the real package name and app name with XXX just here):

application: label='XXX XXX' icon='res/drawable-mdpi/app_icon.png'
launchable-activity: name='XXX.XXX.XXXActivity'  label='XXX XXX' icon='res/drawable-mdpi/app_icon.png'
W/ResourceType( 9132): No known package when getting value for resource number 0
x01080049
ERROR getting 'android:icon' attribute: attribute is not a string value

This happens even though the file do exist inside this folder.

Here's the manifest. Again, replaced the real paths and names of the activities and app with XXX. I can assure you that the paths are correct as the app can run just fine.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="XXX.XXX"
    android:installLocation="auto"
    android:versionCode="2"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <uses-permission android:name="com.android.launcher
                                   .permission.INSTALL_SHORTCUT" />
    <uses-permission android:name="android
                                   .permission.KILL_BACKGROUND_PROCESSES" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_SUPERUSER" />

    <!-- required for admob: -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- required for in-app billing . -->
    <uses-permission android:name="com.android.vending.BILLING" />
    <!-- needed for payload of in-app billing -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <application
        android:name="XXX.XXX.XXX"
        android:allowBackup="true"
        android:description="@string/app_description"
        android:hardwareAccelerated="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="XXX.XXXActivity"
            android:clearTaskOnLaunch="true"
            android:configChanges="keyboard|keyboardHidden|orientation|
                                   screenLayout|uiMode|screenSize|
                                   smallestScreenSize"
            android:finishOnTaskLaunch="true"
            android:icon="@drawable/app_icon"
            android:label="@string/XXX"
            android:launchMode="singleTask"
            android:screenOrientation="fullSensor" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
     ... (other activities and services)

The question

What is going on?

How do I overcome this?

解决方案

If you are using any android system icons as activity icons (i.e. manifest contains <activity ... android:icon="@android:drawable/... ) , they could be the problem. If you are, try copying these icons into your project. Using them elsewhere should be no problem since badging doesn't touch those.

这篇关于得到 &quot;'android:icon' 属性:将 APK 上传到 Play 商店时出现“属性不是字符串值"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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