0

So I imported all the images with the app icon in the mipmap folder and I deleted the round icon folder since I don't need/use any round icons for my app. Then, in the AndroidManifest.xml file I deleted the android:roundIcon="@mipmap/ic_launcher_round"(again, I don't need/use round icons, that's why I deleted this line of code). And that's it, this is how I have been tought to add icons to an app, but when I test this in the Android Studio Virtual Machine, I still get the Android face icon, and I don't know why.. Any help?

This is the Icon I should get

enter image description here

This is my AndroidManifest.xml file

enter image description here

This is the Icon I get (The FunFacts1 app!)

enter image description here

InsaneCat
  • 2,115
  • 5
  • 21
  • 40
Andrew
  • 1
  • 4
  • did you insert the icon manually or through the android tool? – Giulio Pettenuzzo Jul 13 '18 at 10:28
  • checkout: https://stackoverflow.com/questions/5350624/set-icon-for-android-application – InsaneCat Jul 13 '18 at 10:40
  • If that is a 'Google Pixel' emulator, could you try with some other phone emulator please? Round icons are forced in google pixel and you can't do much about it. But even in that case, i would expect the actual app icon to appear round with white padding background. – Janaaaa Jul 13 '18 at 10:57
  • @Andrew have a look at my answer. – HB. Jul 15 '18 at 10:48

5 Answers5

2

Okay, after some testing and research, I found the answer.

If you are targeting 26> (which you will have to do because of the new requirements from the end of the month) your icon will be round, or it will have a round (container) around the icon.

Here is a discussion about this.


I would also advise you to look at adaptive icons, which will now be the required way of setting icons.

By using adaptive icons you can set the background and foreground of your icons and set the shape for different devices:

enter image description here

The answer by @InsaneCat is correct, but it will be deprecated by the end of the month.

You will now have to create adaptive and legacy launcher icons, you can read more about this here.


Last point, which is the most important - always refer to the official documentation as a lot of answers are deprecated and everyone answers just to get reputation points.

HB.
  • 4,116
  • 4
  • 29
  • 53
1

Add below code into your manifest:

<application android:icon="@mipmap/icon_name" android:label="@string/app_name" >
.... 
</application> 

and put ic_launcher in all folders according to icon size

mipmap-ldpi (120 dpi, Low density screen) - 36px x 36px
mipmap-mdpi (160 dpi, Medium density screen) - 48px x 48px
mipmap-hdpi (240 dpi, High density screen) - 72px x 72px
mipmap-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px
mipmap-xxhdpi (480 dpi, Extra-extra-high density screen) - 144px x 144px
mipmap-xxxhdpi (640 dpi, Extra-extra-extra-high density screen) - 192px x 192px

Hope this may help you

InsaneCat
  • 2,115
  • 5
  • 21
  • 40
0

Add this line in you AndroidMmanifest.xml and than try to run it again and what happens.

android:roundIcon="@mipmap/ic_launcher"
Shubham Sejpal
  • 3,556
  • 2
  • 14
  • 31
0

In both places put the same image path:

android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"

if another image you will use so simple paste on mipmap folder

Marco Altieri
  • 3,726
  • 2
  • 33
  • 47
Vishal Sharma
  • 1,051
  • 2
  • 8
  • 15
  • So basically I added 'android:roundIcon="@mipmap/ic_launcher" ' this line of code. I did it and it's still the same... – Andrew Jul 13 '18 at 11:00
0

Okay so I actually found another way... In Android Studio, right click on the app folder and select New-->Image Asset and there click the 3 button next to Path section and there drag and drop your image.

PaulP1
  • 125
  • 1
  • 7