5

I can't really figure out how to change the app's icon that appears when you install the app, the one on the screen that you have to click.

What i did:

  • I created a new icon --> new > Image asset (mipmap)
  • I deleted ic_launcher (the default one)
  • I named the new asset like the old icon (ic_launcher)
  • Rebuild
  • Clean project
  • Invalidate cache and restart
  • Installed app

nothing. I still have my app with the annoying default mipmap ic_launcher icon.

I don't really know what to do more than this..

Can anyone help me?

EDIT: Sorry, I forgot the manifest.

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true" >
...
...
</application>
Pier Giorgio Misley
  • 5,305
  • 4
  • 27
  • 66
  • Hey, I am stuck with the same problem. Can you please provide the solution? http://stackoverflow.com/questions/37411981/app-icon-not-being-set-it-is-always-showing-default-green-android-icon – suku May 24 '16 at 12:29
  • @suku sorry, i forgot doing it. I posted below hoe I solved my problem, hope it helps! – Pier Giorgio Misley May 24 '16 at 12:47
  • 3
    Does this answer your question? [Set icon for Android application](https://stackoverflow.com/questions/5350624/set-icon-for-android-application) – Josh Correia Jul 20 '20 at 16:58

10 Answers10

8

As Suke pointed I forgot posting the solution for this question. Sorry all.

After a lot of managements the solution was easy and it was the one google's one.

this link is where you can create all images for android project.

Go there and:

  • insert your image and select all features
  • download it
  • replace all image formats (xxhdpi, hdpi, ...) in your drawable-xxhdpi, drawable xhdpi,... and mipmap-xxhdpi, mipmap-xhdpi,... folders.
  • in manifest set the android:icon = "@drawable/myicon"

this is how I did it

hope it helps

Pier Giorgio Misley
  • 5,305
  • 4
  • 27
  • 66
2

use this side to create icon by uploading the image (use image button)

https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html#foreground.space.trim=1&foreground.space.pad=0&foreColor=607d8b%2C0&crop=0&backgroundShape=square&backColor=ffffff%2C100&effects=none

and then download and save this in drawable folder of your app and then use

 <application
      android:icon="@drawable/myIcon" >
 </application>

in manifests file.

  • i'm trying, sorry for late reply but i was busy those days – Pier Giorgio Misley Nov 25 '15 at 09:21
  • Ok, with a little adjust it worked: the zip I downloaded, was a res folder with mipmap(for each size) folders inside. i had to rename all mipmap folders into drawable folders and now it works. Do you know why if I refer to a mipmap image the icon is not changing but if i point to a Drawable icon yes? – Pier Giorgio Misley Nov 25 '15 at 09:45
  • yes i know because your icon file are place in the folder of drawable and if you want to show with mipmap folder then you have to do. first place the file ic_launncher(myIcon) in the folder of mipmap and the replace the code in manifests file with this you have to only replace the folder name after @ sign in mainfests file – Muhammad Kashif Arif Nov 26 '15 at 11:44
  • replace your app res folder with res folder from your zip then your old code of mipmap will work. For more detail check my new answer. – Muhammad Kashif Arif Nov 26 '15 at 12:34
2

https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html#foreground.space.trim=1&foreground.space.pad=0&foreColor=607d8b%2C0&crop=0&backgroundShape=square&backColor=ffffff%2C100&effects=none

After generating your icon and downloading the zip file by using the side given above then extract the res folder from zip file and overwrite res folder(by pasting at location e.g. C:\MyApplicaton\app\src\main) of your app with this res folder then your code

android:icon="@mipmap/ic_launcher"

will work.
Note: by overwriting res folder it only add or overwrite the mipmap folders and old folder will remain as it was.

OR

you have to replace the ic_launcher icon in all mipmap folder with new ic_launcher according to the icon size with the help of the side given above.

then it will work

folder name like

mipmap-hdpi

mipmap-mdpi

mipmap-xhdpi

mipmap-xxhdpi

Then your code as given below will work

   <application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true" >
 ...
 ...
 </application>
  • I had no reason to use the tool above, as Android Studio itself will let you pick images (unless you want something really custom). The important part of this answer is the format- modern versions use mipmap instead of the original -drawable. Be very careful that it is in the opening Activity tag in the manifest. It will allow you to paste it outside of this, but it will be ignored. – Sasquatch Nov 18 '20 at 19:41
1

You set your application icon under the <application> tag in your manifest:

<application
    android:icon="@drawable/myIcon" >
</application>

Then just make sure you have a file (such as myIcon.png) within your resources folder (hdpi, xhdpi, etc)

Rein S
  • 889
  • 6
  • 18
  • Have you tried using a unique name? Not sure if using the `ic_launcher` name is giving you troubles (reserved words, maybe?) – Rein S Nov 23 '15 at 16:58
  • 1
    ic_launcher is just the default name. I would double check to make sure that the same icon is being used at all densities. – phxhawke Nov 23 '15 at 17:00
  • sorry for late reply but i was busy those days, my icons have all the same name, i checked.. I created them with "Image asset" for meing sure of it and I checked :( – Pier Giorgio Misley Nov 25 '15 at 09:21
1

first paste icon.png file in drawable folder and modify your code as below

    <application
          android:allowBackup="true"
          android:icon="@mipmap/icon"
          android:label="@string/app_name"
          android:supportsRtl="true" >

    </application>
1

In the Manifest add android:icon="@drawable/Icon" in the

<application android:icon="@drawable/Icon" > </application>

make sure that the icon is present in the folder

Suraj Kumar Singh
  • 140
  • 1
  • 1
  • 6
1

If you still see default android icon, it's simple to fix it... You can use this tools to generate an all-sizes icon. https://appicon.co/ Unzip the mipmap resized file in app res folder. Then in /mipmap-anydpi-v26/ folder, delete both XML files.

Now in the manifest, in the <application> tag, set your icon for both android:icon & android:roundIcon.

Don
  • 3,876
  • 10
  • 47
  • 76
A.R.B.N
  • 1,035
  • 2
  • 10
  • 20
1

As others have pointed out, I created an icon with this link. In my case, I had to adjust both the following parameters to the icon name I added in res.

<application
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher">
</application>
0

If you did not uninstall the App with the old icon and upgraded over it, there is a chance it may display the old icon due to cache. Force stopping the App may help.

Suhas
  • 1,451
  • 14
  • 22
0

Also make sure to update the android:roundIcon="@mipmap/ic_launcher_round" with the new value, this is valid for newer versions of android.

Soham
  • 4,940
  • 3
  • 31
  • 48