V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
spongebobsun
V2EX  ›  Android

[求助] 上传 apk 到 PlayStore 过程中遇到的问题

  •  
  •   spongebobsun · 2016-10-08 16:34:26 +08:00 · 4774 次点击
    这是一个创建于 2728 天前的主题,其中的信息可能已经有所发展或是发生改变。

    上传 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 依旧无效。。。

    有没有遇到过类似问题的老司机给个解决思路啊。。。先谢过。。。

    6 条回复    2016-10-08 18:13:18 +08:00
    inmyfree
        1
    inmyfree  
       2016-10-08 17:33:56 +08:00
    3,4 年前上传过,那时候不是这么玩的....[:dogge]
    skydiver
        2
    skydiver  
       2016-10-08 17:35:57 +08:00
    > android:label 里面不能用 @string
    不用不就行了……
    spongebobsun
        3
    spongebobsun  
    OP
       2016-10-08 17:44:45 +08:00
    @skydiver 问题是没用啊。。。。我直接写了个字符串在里面的
    skydiver
        4
    skydiver  
       2016-10-08 17:55:56 +08:00
    @spongebobsun android:label="@string/app_name" 这是啥?
    spongebobsun
        5
    spongebobsun  
    OP
       2016-10-08 18:12:58 +08:00
    解决了。
    问题不是出在 launch activity 上面,而是后面其他 activity 我有指定 @null 作为 label 。

    aapt 这个报错实在给我看的很蒙,我一直以为是 launchable activity 出的问题。
    spongebobsun
        6
    spongebobsun  
    OP
       2016-10-08 18:13:18 +08:00
    @skydiver 问题解决了。蟹蟹回复。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   956 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:37 · PVG 05:37 · LAX 14:37 · JFK 17:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.