flutter launcher icon does not change
Asked Answered
M

1

8

I have downloaded a sample app project and now I want to change its icon. I have installed the flutter_launcher_icons package. I added this to pubspec.yaml file

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: "^0.11.0"

flutter_icons:
  android: true
  ios: true
  image_path: "assets/icon/logo.png"
  remove_alpha_ios: true
  min_sdk_android: 21

Run the following commands

flutter pub get
flutter pub run flutter_launcher_icons

It gives me success message

 ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.11.0)
  ════════════════════════════════════════════

• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon
• Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
⚠️Requirements failed for platform Web. Skipped
Creating Icons for Windows...
⚠️Windows config is not provided or windows.generate is false. Skipped...
⚠️Requirements failed for platform Windows. Skipped
Creating Icons for MacOS...
⚠️Requirements failed for platform MacOS. Skipped

✓ Successfully generated launcher icons

But When I install the app all I see is the old icon. What might be the cause of the problem?

Maziar answered 8/2, 2023 at 12:20 Comment(4)
for what platform you want to generate iconsHobard
@ManishDayma Android and IOSMaziar
that is already generated try running your application. also uninstall old app first.Hobard
@ManishDayma I already did that but still no use.Maziar
T
9

change your above code to

flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/logo.png"

as you did before run the commands

flutter pub get  
flutter pub run flutter_launcher_icons:main

and then remove your application from android device/emulator. run your application again and the icon will be changed..

Talkfest answered 8/2, 2023 at 13:24 Comment(1)
it worked, thanks. I followed a YouTube tutorial when I changed it to true. what about IOS is it okay like this? or I need to change anything else?Maziar

© 2022 - 2024 — McMap. All rights reserved.