9

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?

asked Feb 8, 2023 at 12:20
4
  • for what platform you want to generate icons Commented Feb 8, 2023 at 12:52
  • @ManishDayma Android and IOS Commented Feb 8, 2023 at 13:01
  • that is already generated try running your application. also uninstall old app first. Commented Feb 8, 2023 at 13:02
  • @ManishDayma I already did that but still no use. Commented Feb 8, 2023 at 13:10

1 Answer 1

10

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

answered Feb 8, 2023 at 13:24
Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.