Android launcher icon still showing default in Android oreo

馋奶兔 提交于 2019-12-04 19:08:12

问题


I Changed my application launcher icon using android studio 3.0.1

File -> Image Asset

In Android version 8.1 icon looks like below image

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

Every help is appreciated,thanks.


回答1:


From Android Oreo (API > 26), you need to change default icons in: mipmap-anydpi-v26 folder.

It is an adaptive icon for any dpi.

res/mipmap-anydpi-v26/ic_launcher.xml file that looks like this:

<adaptive-icon
    xmlns:android="http://schemas.android.com/apk/res/android">
  <background android:drawable="@drawable/ic_launcher_background"/>
  <foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

In order to have your icon you also need to change all drawables (in all density buckets) listed there - namely ic_launcher_background and ic_launcher_foreground

Or you can just delete that folder, in which case android will fallback to using your png icons, but they will not appear as-is and will be commonly drawn on top of white background.

See the answer here:

app launcher icon changed to default icon on Oreo




回答2:


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.




回答3:


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.




回答4:


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.




回答5:


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">



回答6:


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

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



来源:https://stackoverflow.com/questions/48640049/android-launcher-icon-still-showing-default-in-android-oreo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!