上传 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 依旧无效。。。
有没有遇到过类似问题的老司机给个解决思路啊。。。先谢过。。。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.