Android application icon not showing up
Asked Answered
B

13

28

I've just spent numerous hours constructing an icon for an Android app I'm working on, but can't get it to show up for the app in the emulator.

I've put it in res/drawable-hdpi, res/drawable-mdpi, res/drawable-ldpi in the respective sizes as defined in http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html

The manifest contains the line:

 <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">

Any ideas as to why it isn't showing up?

Burger answered 23/1, 2011 at 22:16 Comment(4)
Did you name it properly? Assuming you did not change the manifest, the default icon is called icon.png and is an android icon. Simply replace this icon with your own and it should work.Spanishamerican
and what shows up instead? are you getting any error?Unaccomplished
I solved this issue by rebooting my device. :)Redaredact
For me the solution was to change the launcher's theme, it had chached the development icon.Norton
P
28
  1. Make sure the icon is stored with the name icon.png in those folders.
  2. Make sure android has a drawable/icon resource. Check this by looking at your gen/R.java file and seeing public static final int icon = 0x.... in the drawable inner class.
  3. Try cleaning your project build and uninstalling any existing version of your app from your phone/emulator and then reinstall the new version.
Promiscuous answered 23/1, 2011 at 22:25 Comment(4)
The icon wasn't called icon.png, and I'd put it in the wrong place (not replacing the default icons). Thank you all!Burger
I should add that it doesn't have to be called icon.png, but the name must match with whatever you chose in your android:icon="@drawble/..." line.Promiscuous
I'd like to emphasize part of the third step „cleaning your project build”: make sure you click on Project/Clean… and the clean your project. This did it in my case!Maighdlin
@Promiscuous since your answer has so much vote, can you add the following pointer too: Make sure that intent-filter for MAIN and LAUNCHER is not mixed with other intent-filter.Starryeyed
C
34

I would like to elaborate on the answers of @Britton Pentakill and @arnav bhartiya because I could solve my problem using their answers. I added more actions on my MainActivity because Android Studio was complaining that "App not indexable by Google" and I also wanted it to be indexable.

Wrong AndroidManifest.xml:

<intent-filter>
  <action android:name="android.intent.action.MAIN"/>
  <category android:name="android.intent.category.LAUNCHER"/>
  <action android:name="android.intent.action.SEND"/>
  <action android:name="android.intent.action.VIEW"/>
  <category android:name="android.intent.category.BROWSABLE"/>
  <data android:scheme="https"
        android:host="siara.cc"
        android:pathPrefix="/CrossCalc" />
 </intent-filter>

So when I published my app, people could not find my App Icon on their device, no Open button after installing on Play console, even if it did pass review and published on play store (it took 7 days).

Then when I read their answers, I corrected and now I am able to see the icon for opening my app:

Correct:

<intent-filter>
  <action android:name="android.intent.action.MAIN"/>
  <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
  <action android:name="android.intent.action.VIEW"/>
  <category android:name="android.intent.category.DEFAULT"/>
  <category android:name="android.intent.category.BROWSABLE"/>
  <data
    android:scheme="https"
    android:host="siara.cc"
    android:pathPrefix="/CrossCalc"/>
</intent-filter>
Clansman answered 11/9, 2019 at 18:13 Comment(4)
worked for me! Guys If you dont configure manifest correctly cause your application is not instable.. And There be not install button Play store in app landing page!Andorra
it's my first time encountering this as well.Jeanelle
Thank you so much for this solution, It help me as wellHomophonic
Worked like a magic. ThanksCommendatory
P
28
  1. Make sure the icon is stored with the name icon.png in those folders.
  2. Make sure android has a drawable/icon resource. Check this by looking at your gen/R.java file and seeing public static final int icon = 0x.... in the drawable inner class.
  3. Try cleaning your project build and uninstalling any existing version of your app from your phone/emulator and then reinstall the new version.
Promiscuous answered 23/1, 2011 at 22:25 Comment(4)
The icon wasn't called icon.png, and I'd put it in the wrong place (not replacing the default icons). Thank you all!Burger
I should add that it doesn't have to be called icon.png, but the name must match with whatever you chose in your android:icon="@drawble/..." line.Promiscuous
I'd like to emphasize part of the third step „cleaning your project build”: make sure you click on Project/Clean… and the clean your project. This did it in my case!Maighdlin
@Promiscuous since your answer has so much vote, can you add the following pointer too: Make sure that intent-filter for MAIN and LAUNCHER is not mixed with other intent-filter.Starryeyed
D
13

Notice Win Myo Htet's comment on the accepted answer. He solved my problem.

Jems since your answer has so much vote, can you add the following pointer too: Make sure that intent-filter for MAIN and LAUNCHER is not mixed with other intent-filter. – Win Myo Htet Dec 6 '15 at 5:47

"mixed" being the keyword. I had intent in my AndroidManifest.xml file that was there to prevent all file types from being available in file selects. While it began with the second answer's solution, it contained the extra intent for the file selects. This prevented Android from installing my icons when installing the app. I wanted to post this in case anyone else ran into this issue since Win My Htet's brilliant advice could easily be missed since it is essentially one word "mixed"

Digestant answered 26/1, 2018 at 0:42 Comment(2)
Thank you for pointing this out Britton. It was exactly the problem I was having.Monovalent
Yes, that was may problem, too. Thank you! Upvoted. Make sure you only have the MAIN and LAUNCHER intents ONLY. Otherwise, the app icon won't show up on the phone.Lillie
S
5

Make sure that the Intent of your Launcher Activity is named MAIN i.e,

<intent-filter>
        <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

Moreover, add the icon to your Drawable folders and then refer it in the application block of Manifest.

<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
Significative answered 18/11, 2015 at 0:34 Comment(1)
+1 for having people pay attention to their Manifest file. I have had really tricky icon problems show up because of this file being slightly misconfigured.Centaur
D
2

In my case after assigning both ic_launcher and ic_launcher_round in all mipmap folders I had to remove the following folder "mipmap-anydpi-v26" in order to show app Icon.

Dimorphous answered 26/7, 2021 at 9:58 Comment(0)
A
1

I had a similar problem recently and I eventually found out there were two causes:

  • File extension: To stay on the safer side, always stick to .png format. Some other formats actually work on certain devices (e.g using a .jpg icon still showed up on my Infinix note 4 phone) but .png files are guaranteed to work on all devices.

  • Storage location: Your icon file should be in the drawable folder. Remember to do a double check as to whether your manifest file points to the place you saved your drawable too.

I hope this helps.. Merry coding!

Autorotation answered 2/12, 2018 at 17:43 Comment(0)
C
1
<manifest ...>

    <application
        android:icon="..."
        android:roundIcon="..."/>
</manifest>

In application of manifest of your app there are two attributes, icon & roundicon. one is for debug and another is for release.

Copaiba answered 2/2, 2020 at 6:53 Comment(2)
It's not one for debug and another for release, It works in the following way: If your phone theme has square icons than it'll fetch app icon from attribute "icon" and if your phone theme has round icons then it'll fetch app icon from attribute "roundIcon".Cartesian
removing round icon paved the way for me , but like syed said it is not for debug / testing.Engender
S
1

For displaying icons you need to replace the @drawable in the theme style and it will work enter image description here

Sphericity answered 25/7, 2020 at 8:27 Comment(0)
T
0

Add this:

android:roundicon also
Tolerance answered 23/1, 2011 at 22:16 Comment(1)
I did have this on my manifest, but still did not solve the problem OP has posted.Clansman
W
0

If you are running on Android 5.0, just add these lines into the onCreate method, inside MainActivity:

getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.drawable.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);

It might help in your case.

Whitby answered 9/4, 2015 at 20:16 Comment(0)
T
0

in intent filter tag only action and category are allow not others tag. if any wrong tag in intent filter tag then you can not open and see your application in mobile phone.

<intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
<!--                <action android:name="android.intent.action.SENDTO" />-->
<!--                <data android:scheme="mailto" />-->
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
Tula answered 4/2, 2022 at 12:32 Comment(0)
G
0

I think it will work in app icon changes..

Griddle answered 6/6, 2023 at 3:10 Comment(0)
I
0

In my case, the app icons are not visible though I have checked the icon attribute under application tag and with the existence of Main and Launcher things. The issue is reproducible in android 11. I have fixed this using roundIcon attribute under application tag in manifest. If build failed with duplicate roundIcon exists already, try using replace like this,

        tools:replace="android:roundIcon">
Irrupt answered 29/10, 2023 at 8:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.