How to change android icon in flutter?

我的梦境 提交于 2021-01-28 18:41:11

问题


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?


回答1:


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.




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/61442634/how-to-change-android-icon-in-flutter

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