Flutter Launcher icon doesn't change the icon - flutter

I already type this to my terminal and the icon for my app didn't change
flutter pub get
flutter pub run flutter_launcher_icons:main

Make sure you've set the app icon path in android/app/src/main/AndroidManifest.xml
android:icon="#mipmap/ic_launcher"

Try below code hope its help to you.
Add below package in your pubspec.yaml file
flutter_launcher_icons: ^0.9.2
Add below code pubspec.yaml file
flutter_icons:
image_path: "assets/icon.png"
android: true
ios: true
then run below command
flutter pub run flutter_launcher_icons:main

Related

flutter launcher icon does not change

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

error with flutter flutter_launcher_icons

I'm trying to use the error with flutter flutter_launcher_icons plugin to change the launcher icons.
Before I replaced the icons in the folder but this time I want to use this plugin made for that, but I get an error when I run:
flutter pub run flutter_launcher_icons:main
Here is the error:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
shared_preferences: ^2.0.12
google_fonts: ^2.2.0
flutter_screenutil: ^5.0.3
animated_text_kit: ^4.2.1
shake: ^2.0.0
shake_event: ^0.0.9
flutter_launcher_icons: ^0.9.2
flutter_icons:
image_path_android: "assets/icone-appi.png"
image_path_ios: "assets/icone-appi.png"
android: true
ios: true
I tried to modify the spaces in the writing, but nothing changes.
I thought it would be easier to set up, but I can't find the error.
Thank you for your help
1. Set up the config FIle
add your logo file (ex: logo.png) into assets folder, you have to create the folder first
add flutter_launcher_icons packages in your pubspec.yaml
add a line like this to your package's pubspec.yaml
dev_dependencies:
flutter_launcher_icons: ^0.9.2
flutter_icons:
android: true
ios: true
iamge_path: "assets/logo.png"
2. Run the package
After setting up the configuration, all that is left to do is run the package in the terminal.
flutter pub get
flutter pub run flutter_launcher_icons:main

I am setting Flutter launcher icon using flutter_launcher_icons: ^0.9.2 but when I run command it shows error NoConfigFoundException

PS F:\Hitesh\Orhan\Flutter\Arfic\arificapp> flutter pub get
Running "flutter pub get" in arificapp... 4.7s
PS F:\Hitesh\Orhan\Flutter\Arfic\arificapp> flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.9.1)
════════════════════════════════════════════
✗ ERROR: NoConfigFoundException
Check that your config file `flutter_launcher_icons.yaml` has a `flutter_icons` section
you need to add your own configuration before do that, look this example:
Go example

Check that your config file `flutter_launcher_icons.yaml` has a `flutter_icons` section

any one have solution to this problem i am running flutter pub run flutter_launcher_icons:main
and it is not working for me
Your pubspec.yaml should be like this:
dev_dependencies:
flutter_launcher_icons: "^0.9.2"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Notice where flutter_launcher_icons was used and where
flutter_icons was used.
I just solved the same error you have, and it was something so simple that many of us do not realize it sometimes.
Verify that the terminal is in your project folder.
Try putting flutter_launcher_icons: any in the dev_dependencies: section like in the image.
Verify correct indentation in pubspec.yaml
click to see image
if you facing this problem
✗ ERROR: NoConfigFoundException
Check that your config file flutter_launcher_icons.yaml has a flutter_icons section
try this
uninstall the app from the phone or emulator
Go To Power Shell and run as Administrator
cd ( your project path )
flutter pub get
flutter pub run flutter_launcher_icons:main
flutter run
Just ... Restart android studio
run
flutter clean
flutter pub get
flutter pub run flutter_launcher_icons:main
flutter run

Issue with the installation of flutter_launcher_icons

I added the flutter package "flutter_launcher_icons" but get problems when try to use it.
My "pubspec.yaml":
environment:
sdk: ">=2.13.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_blue: ^0.8.0
csv: ^5.0.0
share: ^2.0.4
path_provider: ^2.0.2
flutter_launcher_icons: ^0.9.0
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/Logo.png"
adaptive_icon_background: "assets/launcher/background.png"
adaptive_icon_foreground: "assets/launcher/foreground.png"
When I run "pub get" I get this (looks OK):
C:\src\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in ble_thms... 790ms
Process finished with exit code 0
But when I try to run the "flutter_launcher_icons" I get this:
C:\src\flutter\packages\flutter_tools>flutter pub run flutter_launcher_icons:main
Could not find package "flutter_launcher_icons". Did you forget to add a dependency?
pub finished with exit code 65
When I try to install "flutter_launcher_icons via terminal its the same:
C:\src\flutter\packages\flutter_tools>flutter pub get flutter_launcher_icons
Running "flutter pub get" in .... 894ms
C:\src\flutter\packages\flutter_tools>flutter pub run flutter_launcher_icons:main
Could not find package "flutter_launcher_icons". Did you forget to add a dependency?
pub finished with exit code 65
How can I solve this problem to use the package "flutter_launcerh_icons"? I also already tried "pub upgrade" and "pub outdated".
add the dependency **flutter_launcher_icons** like so:
flutter pub add flutter_launcher_icons
then:
flutter pub run flutter_launcher_icons:main
Hope this helps anyone with the same issues in the future.
The dependency is dev dependency, so it must go under dev_dependencies list.
dev_dependencies:
flutter_launcher_icons: "^0.9.0"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Dev dependency are not necessarily ran on "flutter run", but rather with specific command, like:
flutter pub run flutter_launcher_icons:main -f "pubspec.yaml'
Please refer to installation guide on pub.dev
You should be try to use below dependency:
flutter_launcher_icons: ^0.8.0
Below is your pubspec.yaml file:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.8.0"
flutter_icons:
image_path: "assets/icon/Logo.png"
android: true
ios: true
Prepare an app icon for the specified path. e.g. icon/icon.png
Execute command on the terminal to Create app icons:
flutter pub get
flutter pub run flutter_launcher_icons:main
OK, it seems that there is a problem with the flutter_tools and the dependence on "image"
C:\src\flutter\packages\flutter_tools>flutter pub add flutter_launcher_icons
The current Dart SDK version is 2.13.4.
Because flutter_launcher_icons <0.4.0 requires SDK version >=1.20.1 <2.0.0 and flutter_launcher_icons >=0.4.0 <0.7.1 depends on image ^2.0.0, flutter_launcher_icons <0.7.1 requires image ^2.0.0.
And because flutter_launcher_icons >=0.7.1 <0.9.0 depends on yaml ^2.1.15 and flutter_launcher_icons >=0.9.0 depends on args 2.0.0, every version of flutter_launcher_icons requires args 2.0.0 or image ^2.0.0 or yaml ^2.1.15.
And because flutter_tools depends on both args 2.1.0 and yaml 3.1.0, every version of flutter_launcher_icons requires image ^2.0.0.
So, because flutter_tools depends on both image ^3.0.2 and flutter_launcher_icons any, version solving failed.
Can I "downgrade" somehow the "flutter_tools" ?
Found the problem:
I somehow changed the path in the Android Studio Console to "C:\src\flutter\packages\flutter_tools".
So I changed it back to the project path "C:\src\Android\AndroidStudioProjects\my_flutter_project".
Now it is working.
Clumsy mistake from my side. :-(
This is how I solved my problem, type this command in the code editor terminal:
flutter pub add package_name
or, if it already exist:
flutter pub upgrade package_name
Hopefully it will solve the problem
I got the same error and i find that i wrote laucher instead of launcher in my command line
I just solved the same error you have, and it was something so simple that many of us do not realize it sometimes.
Verify that the terminal is in your project folder.
Try putting flutter_launcher_icons: any in the dev_dependencies: section like in the image.
Verify correct indentation in pubspec.yaml
click to see image
I had the same problem,
flutter clean
then
flutter pub get
solved it.