Once a while, I have temporarily set icon A as the app icon and is was successfully set in Android device. Now I would like to change to icon B, I added the ico file to the project, modified pubspec.yaml (letter cases are correct), update dependencies (actually I restarted Android Studio) and build. The app icon still remains the old icon A. Moreover, I build the app directly to my iPhone through XCode, the app icon is still the flutter icon.
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.11.0"
flutter_icons:
android: true
ios: true
image_path: "images/AST.ico"
Related
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..
i'm using flutter_launcher_icons to generate a icon on my flutter application
here's my yaml
flutter_icons:
image_path: "assets/images/icon_launcher.png"
adaptive_icon_background: "assets/images/icon_launcher_background.png"
adaptive_icon_foreground: "assets/images/icon_launcher_foreground.png"
# adaptive_icon_foreground: "assets/images/icon_launcher_foreground2.png"
android: true
ios: "AppIcon"
remove_alpha_ios: true
and i'm running
flutter pub get
flutter pub run flutter_launcher_icons:main
but my icon is losing quality, what should i do, i already tried with different images and sizes
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 trying to change the icon of my app, so I modified my pubspec.yaml file to add some dependencies. But after that I'm getting the following error:
"Error on line 24, column 5 of pubspec.yaml: A version constraint must
be a string."
This is the code:
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.7.3"
flutter_icons:
ios: true
android: true
image_path: "assets/icon.png"
flutter:
uses-material-design: true
assets:
- assets/icon.png
firebase_core: 0.3.1+1
Thank you in advance.
You have placed your dependencies incorrectly, and also missed the dependencies keyword from the pubspec.yaml file.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
firebase_core: 0.3.1+1
You used a double qoute with a dependency version : flutter_launcher_icons: "^0.7.3" . It should be flutter_launcher_icons: ^0.7.3
You didn't place your dependencies under the dependencies keyword.
I can tell you one more way of changing you app icon.
Download your icon and generate a custom icon for different screen size using app icon generator - https://appicon.co/ and select the devices for which your application has to work, this website will generate you custom icons. Download the generated icons extract it in a convenient place in your machine.
For Android:
click on your project on the left files - navigate to Android folder -> app -> src -> main -> res -> right click on reveal in finder, replace all the mipmap folder with the one generated using appicon.co
For iOS:
click on ios folder -> Runner -> Assets.xcassets - > AppIcon.appicon.set -> Reveal in finder. now replace all the content in the folder with the one generated using the appicon.co
stop and restart your application, and the icon should be changed
Here is the image_picker i added in pubspec.yaml file
dependencies:
flutter:
sdk: flutter
url_launcher: ^4.0.3
google_maps_flutter: ^0.0.3+3
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
image_picker:
I cant able to import the image picker in my class
Ensure you run flutter packages get
If it still does not work restart your IDE.
I was also facing the same problem. Things that I did and after which it worked for me were:
1. Running the command in the terminal:
flutter packages get
Restarting the IDE
Clearing up all the pending updates.
Hope it helps, make sure all the updates are completed. There's 90 percent chance it will work.