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?

Dan
  • 572
  • 1
  • 5
  • 11
  • 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. – f20k Jan 23 '11 at 22:22
  • and what shows up instead? are you getting any error? – bigstones Jan 23 '11 at 22:23
  • I solved this issue by rebooting my device. :) – Allen Apr 30 '15 at 22:11
  • For me the solution was to change the launcher's theme, it had chached the development icon. – Cr4xy Nov 07 '21 at 09:08

12 Answers12

32

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>
Arundale Ramanathan
  • 1,781
  • 1
  • 18
  • 25
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.
Cristian
  • 198,401
  • 62
  • 356
  • 264
Jems
  • 11,560
  • 1
  • 29
  • 35
  • 1
    The icon wasn't called icon.png, and I'd put it in the wrong place (not replacing the default icons). Thank you all! – Dan Jan 23 '11 at 22:38
  • 10
    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. – Jems Jan 23 '11 at 22:40
  • 1
    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! – Dunken Feb 16 '13 at 11:44
  • 3
    @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 06 '15 at 05:47
11

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"

Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
  • Thank you for pointing this out Britton. It was exactly the problem I was having. – Peter Machowski Jul 10 '18 at 22:38
  • 1
    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. – ONE Aug 06 '19 at 21:30
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" >
arnav bhartiya
  • 303
  • 1
  • 3
  • 9
  • +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. – Shadoninja Jun 30 '16 at 06:53
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!

Taslim Oseni
  • 6,086
  • 10
  • 44
  • 69
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.

MMG
  • 3,226
  • 5
  • 16
  • 43
  • 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"**. – syed dastagir Nov 18 '20 at 11:51
  • removing round icon paved the way for me , but like syed said it is not for debug / testing. – Vivek Oct 12 '21 at 12:02
1

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

Kamal
  • 245
  • 2
  • 3
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.

sam100rav
  • 3,733
  • 4
  • 27
  • 43
0

Add this:

android:roundicon also
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
0

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.

TapulaRasa
  • 325
  • 3
  • 13
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>
Rishita Joshi
  • 203
  • 2
  • 3
0

I think it will work in app icon changes..