背景
经过这么多小时的空闲时间,我准备将我的第一个应用程序发布到 Play 商店,但遗憾的是我在上传签名的应用程序时遇到了困难。
我已经使用我创建的密钥库成功导出了应用程序(全部通过 Eclipse 和 ADT),因此我将签名的 APK 上传到 Play 商店(here https://play.google.com/apps/publish/).
问题
我不断收到这样的消息:
上传失败 无法使用“aapt dump badging”分析您的 APK。
错误输出:无法运行 aapt dump badging: W/ResourceType(14856):
获取资源号 0x01080049 的值时没有已知的包
获取“android:icon”属性时出错:属性不是字符串
价值
as such:
该应用程序本身在真实设备上运行得很好,并且使用的图像文件是普通的 PNG 文件,如android-assets-studio 网站 http://android-ui-utils.googlecode.com/hg/asset-studio/dist/icons-launcher.html.
我尝试过的
我在 StackOverflow 上搜索过,发现了很多关于它的帖子(here https://stackoverflow.com/search?q=%E2%80%9CERROR%20getting%20%27android:icon%27%20attribute:%20attribute%20is%20not%20a%20string%20value%E2%80%9D)。我读过其中的很多内容并尝试了接下来的事情,但没有任何帮助:
将应用程序图标放在不同的文件夹(“drawable”,“drawable-mdpi”,...甚至“drawable-xxxhdpi”)上,并具有多种组合(从每个文件夹中放置/删除)。
在“应用程序”标签和启动器活动标签上设置标签、图标和主题。
更改图像文件名和文件本身(将其替换为默认应用程序图标)。
清理项目。
检查 Lint 消息。
更新 ADT(至 22.3.0.v201310242005-887826)、Eclipse(至 Kepler Service Release 1)、SDK 工具(至 22.3)、SDK 构建工具(至 19.0.1)。一切几乎都是最新的官方版本。
检查是否没有使用双 jar 文件(多个库上不存在 jar 文件,特别是如果它具有不同的版本)。
尝试将 strings.xml 放入“res/values-en”而不是“res/values”
尝试将“android:value”属性添加到清单上的所有元数据标签中(由 Google 建议)。它不起作用。事实上,在我读过的所有教程中,我从未见过 AppWidget 有这样的要求,所以我认为无论如何都不需要。
-
尝试了 aapt 命令:
aapt dump badging
这向我展示了 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): No known package when getting value for resource number 0
x01080049
ERROR getting 'android:icon' attribute: attribute is not a string value
即使该文件确实存在于该文件夹中,也会发生这种情况。
这是清单。再次将活动和应用程序的真实路径和名称替换为 XXX。我可以向您保证路径是正确的,因为应用程序可以正常运行。
<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)
问题
到底是怎么回事?
我该如何克服这个问题?