18

I changed my application launcher icon using Android Studio 3.0.1:

File -> Image Asset

In Android 8.1, the icon looks like below image:

enter image description here

My AndroidManifest details

 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:hardwareAccelerated="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

I double checked the icons.ic_launcher and ic_launcher_round are my new icons.

halfer
  • 19,824
  • 17
  • 99
  • 186
CLIFFORD P Y
  • 16,974
  • 6
  • 30
  • 45
  • What I understood is that you are replacing default `ic_launcher` to your icon?? And while replacing this icon the launcher icon still shows its default icon. Am I right?? – MashukKhan Feb 06 '18 at 10:35
  • @MashukKhan yes,I replaced icon with the help of android studio – CLIFFORD P Y Feb 06 '18 at 10:36
  • For some weird reason i am having same issue. I used legacy option to update launcher icons. Checked i don't have any default icon in my project. New icon is shown in the launcher but recent tray and settings still show default icon. – Skyyy Feb 07 '18 at 02:16

7 Answers7

14

Best solution is delete mipmap-anydpi-v26 folder then app will take default icon. In android studio Project mode go to this package

res/mipmap-anydpi-v26

delete it and rebuild and Run program.

sasikumar
  • 12,540
  • 3
  • 28
  • 48
  • 3
    Deleting the `mipmap-anydpi-v26` isn't the best solution. It just avoid the issue which the OP doesn't have the right files to support new feature introduced in 8.0 (API 26). His project contains not only his icon (ic_launcher for up to 7.0, ic_launcher_round for 7.1), but also new and default `ic_launcher_background` and `ic_launcher_foreground` under drawable. – John Pang Apr 02 '19 at 07:09
7

I solved my issue by changing

classpath 'com.android.tools.build:gradle:2.3.3'

to

classpath 'com.android.tools.build:gradle:3.0.1'

in project build-gradle

dependencies {
        //classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.android.tools.build:gradle:3.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

this will cause a flavoring issue ,that can be solved by adding

flavorDimensions "default"

in application build-gradle

android {

...
flavorDimensions "default"
defaultConfig {
}


}

this may help some one with same problem.

CLIFFORD P Y
  • 16,974
  • 6
  • 30
  • 45
  • This causes a build break with Android Studio 3.4.1 where `classpath` is not recognized. – kakyo Jul 31 '19 at 08:01
6

You Need Put Round Icon for 8.1

 <application
    android:name=".aaa"
    android:allowBackup="true"
    android:roundIcon="@mipmap/ic_launcher"
    android:icon="@mipmap/ic_launcher"
    android:label="aaa"
    android:theme="@style/AppTheme">
Ricky Patel
  • 465
  • 2
  • 12
6

I had the same problem - a default icon was showing up in the task switcher. What fixed it for me is removing the round icon from my manifest.

As per the documentation for Adaptive icons,

You must only use the android:roundIcon attribute if you require a different icon asset for circular masks, if for example the branding of your logo relies on a circular shape.

(emphasis mine)

My app does not need a different asset for circular masks - removing the reference to the round icon from the manifest caused Android to show the correct launcher icon in the task switcher.

Vijayendra Vasu
  • 271
  • 3
  • 7
2

In Android Studio, use Image Asset to (re)create your icons. On Windows, ctrl+shift+A. On Mac, cmd+shift+A. When you are done, save and overwrite existing files. Then the problem will be fixed.

Most likely you'll provide your own icon and your background color (which will be just a resource in colors). Image Asset will created a set of new ic_launcher_foreground.png. You'll find two set of (now) unused resources: ic_launcher_background.xml (which gives the green background with grid) and ic_launcher_foreground.xml (which gives the Droid head). You can safely remove those files.

John Pang
  • 2,403
  • 25
  • 25
1

In Android Studio Go to File -> New -> Image Asset -> Then browse your launcher icon which you want to use and click next to finish the process. Try to use 1024x1024 size image or at least 512px . See the picture below for clear understanding.

Step 1: Go to File -> New -> Image Asset

enter image description here

Step 2: Then Choose your launcher image and click next to finish the process it will replace your current launcher image. See the image for other setting also like you must select Icon Type: Adaptive and Legacy

enter image description here

1

I had the same symptoms, where my imported SVG image would not show up on API 26+, but it turned out to be an issue with the complexity of the source SVG. I opened the SVG in Inkscape, found a particularly complex path in the image then:

Extensions > Modify Path > Flatten Beziers...

As mentioned here: SVG: simplify path to remove curves?

After re-importing the SVG it worked fine.

Steve Moseley
  • 5,797
  • 2
  • 19
  • 22