问题
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