Android market publishing: 'android:icon' attribute: attribute is not a string value

雨燕双飞 提交于 2019-12-29 08:18:14

问题


I'm trying to publish an app to the Android Market, I get the following error:

W/ResourceType(16964): No known package when getting value for resource number 0x01030006 ERROR getting 'android:icon' attribute: attribute is not a string value

Here is the AndroidMannifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="it.prezzofelice.android"
    android:versionCode="6"
    android:versionName="1.0.05"
    >

    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15" />

    <!-- Prezzofelice -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- C2DM -->
    <permission android:name="it.prezzofelice.android.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="it.prezzofelice.android.permission.C2D_MESSAGE" />    
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- Flurry -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@android:style/Theme.NoTitleBar"
        android:theme="@style/AppTheme"
        android:name=".MainApplication"
        >

        <uses-library android:name="com.google.android.maps" />

        <activity
            android:name=".SplashActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:launchMode="singleInstance"
            android:label="@string/app_name"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".MainActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".deals.DealsListActivity"
            android:theme="@style/AppTheme"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name"
            />

        <activity
            android:name=".deals.DealDetailsActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".deals.CityListActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".deals.BuyActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".coupons.CouponListActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".profile.ProfileActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".deals.DealMapActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".profile.LoginRegisterActivity"
            android:theme="@style/AppTheme"
            android:launchMode="singleTop"
            android:label="@string/app_name"
            />

        <activity
            android:name=".profile.LoginActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".profile.RegisterActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <activity
            android:name=".coupons.CouponDetailsActivity"
            android:theme="@style/AppTheme"
            android:label="@string/app_name"
            />

        <service
            android:name=".BrowserService"
            />

        <receiver
            android:name=".c2dm.C2DMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND"
            >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="it.prezzofelice.android" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="it.prezzofelice.android" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>            
        </receiver>

    </application>

</manifest>

I already tried both these methods with no luck:

"ERROR getting 'android:icon' attribute: attribute is not a string value" when trying to upload to the Android Market

  • I have defined a values/strings.xml with the "app_name" string.

  • I have created a "drawable" folder with ic_launcher.png copied from drawable-hdpi

Any hint?

Thanks, regards Maurizio


回答1:


I would try to clean the project and build a new apk.

In Eclipse: Click Project > Clean.. > Select your project and click Ok

I don't know why you are putting a style into the android:label attribute in the application tag. As far as I know this should be @string/app_name.




回答2:


I had the same problem for another reason.

In fact, I had set some values to null like this

<activity
    android:name=".MyActivity_"
    android:label="@null"
    android:launchMode="singleTask"
    android:screenOrientation="portrait" >
</activity>

And I fixed the problem to replace all "@null" to "".

<activity
    android:name=".MyActivity_"
    android:label=""
    android:launchMode="singleTask"
    android:screenOrientation="portrait" >
</activity>

The application behavior is the same but in first case, we can publish and in second case, we can't




回答3:


Is your application localized in multiple languages? If so, then you need to make sure that you have correctly defined your strings in the default res/strings.xml file.

Cleaning/restarting eclipse sometimes does the trick too, as mentioned above :)



来源:https://stackoverflow.com/questions/10452008/android-market-publishing-androidicon-attribute-attribute-is-not-a-string-v

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!