上传 apk 时 play store 给出的报错是 -
Upload failed
Your APK cannot be analyzed using aapt. Error output:
Failed to run aapt dump badging:
ERROR getting 'android:label' attribute: attribute is not a string value
于是本地跑了一下 aapt , 结果是这样婶儿的 -
➜ Desktop /Developer/Android/sdk/build-tools/24.0.0/aapt dump badging app-release.apk
package: name='sun.bob.leela' versionCode='1' versionName='1.0' platformBuildVersionName=''
sdkVersion:'16'
targetSdkVersion:'24'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.VIBRATE'
uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'
application-label-zh:'Puff'
application-icon-120:'res/mipmap-mdpi-v4/ic_launcher.png'
application-icon-160:'res/mipmap-mdpi-v4/ic_launcher.png'
application-icon-240:'res/mipmap-hdpi-v4/ic_launcher.png'
application-icon-320:'res/mipmap-xhdpi-v4/ic_launcher.png'
application-icon-480:'res/mipmap-xxhdpi-v4/ic_launcher.png'
application-icon-640:'res/mipmap-xxxhdpi-v4/ic_launcher.png'
application-icon-65534:'res/mipmap-mdpi-v4/ic_launcher.png'
application: label='Puff' icon='res/mipmap-mdpi-v4/ic_launcher.png'
launchable-activity: name='sun.bob.leela.ui.activities.SplashActivity' label='Puff' icon=''
ERROR getting 'android:label' attribute: attribute is not a string value
➜ Desktop
第一次上传 app ,不知道是做错了啥, google 了一圈发现说好像是 aapt 的 bug , android:label 里面不能用 @string ,于是瞅了下我的 manifest -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sun.bob.leela">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".ui.activities.SplashActivity"
android:label="Puff"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
这就很尴尬了。。。也怀疑过是多语言的问题,这个 app 里面有中文和英文两个 string.xml ,尝试删除中文的 string.xml 依旧无效。。。
有没有遇到过类似问题的老司机给个解决思路啊。。。先谢过。。。
1
inmyfree 2016-10-08 17:33:56 +08:00
3,4 年前上传过,那时候不是这么玩的....[:dogge]
|
3
spongebobsun OP @skydiver 问题是没用啊。。。。我直接写了个字符串在里面的
|
4
skydiver 2016-10-08 17:55:56 +08:00
@spongebobsun android:label="@string/app_name" 这是啥?
|
5
spongebobsun OP 解决了。
问题不是出在 launch activity 上面,而是后面其他 activity 我有指定 @null 作为 label 。 aapt 这个报错实在给我看的很蒙,我一直以为是 launchable activity 出的问题。 |
6
spongebobsun OP @skydiver 问题解决了。蟹蟹回复。
|