androidgoogle-playapkaapt

getting " 'android:icon' attribute: attribute is not a string value” error while uploading an APK to the play store


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:

enter image description here

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?


Solution

  • 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.