简体   繁体   中英

How to change android icon in flutter?

After running a flutter app, it gets correctly deployed to an Android Virtual Device.

While in the virtual device, I can notice that the icon chosen for the app shows up correctly among other existing apps.

But, when I tap to see running processes, an Android icon appears at the top of the flutter app window.

Icons were manually added as described here .

How can I change this default icon to use mine?

在此处输入图像描述

one of my favorite library that you can use it will generate iOS and android icon for you https://pub.dev/packages/flutter_launcher_icons

Check again your AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.snapio">

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="flutter"
    android:icon="@mipmap/ic_launcher">

You have to change your icon name inside this file.

For Android 10 you have to provide an adaptive icon for it to show up in the task switcher. More info here: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive

Change application icon in flutter from pubspec.yaml by setting the flutter_icons tag like this:

flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "images/icon/icon.png" # your full path in assets directory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM