TBC
TBC

Reputation: 9

Android-Manifest 'android:icon' is not a string value

When I try to upload my APK to the Google Play Store Console, it says that the 'android:icon' value in Android Manifest is not a string value. But if I take away the sting quotes, it gives me another error. How do I fix this?.

I have tried taking away the string quotes, but when I do, it gives me another error

android:icon="@android:color/background_dark"

NOTE: I am using android studio

Upvotes: 0

Views: 151

Answers (3)

Gourav
Gourav

Reputation: 2819

You cannot use simple colors for icons, you have to specify a icon drawable,

You have to specify it like this:

android:icon = "@folder/icon"

For example, if your folder is drawable and the name of the icon is logo, then your attribute should be like this:

android:icon = "@drawable/logo"

Upvotes: 0

Farid Haq
Farid Haq

Reputation: 4199

Icon values of these attributes should be localized and therefore set from a resource or theme. Resource values are expressed in the following format,

@[package:]type:name

where the package name can be omitted if the resource is in the same package as the application, type is a type of resource — such as "string" or "drawable" — and name is the name that identifies the specific resource.

For example:

<activity android:icon="@drawable/smallPic" . . . >

Values from a theme are expressed in a similar manner, but with an initial '?' rather than '@':

?[package:]type:name

String values Where an attribute value is a string, double backslashes ('\') must be used to escape characters — for example, '\n' for a newline or '\uxxxx' for a Unicode character.

Upvotes: 0

Tammana Nankani
Tammana Nankani

Reputation: 41

You have to mention the path for the image you want to display which can be fetched from the drawable or mipmap package of the res package

android:icon="@mipmap/ic_launcher"

or android:icon="@drawable/app_logo"

Upvotes: 2

Related Questions