I Tried changing my app's Icon on apk but it's not changing. I generated an icon on https://appicon.co/ and try changing but it's showing flutter's default app icon.
Try this flutter_launcher_icons
In pubsec.yaml
dev_dependencies:
flutter_launcher_icons: "^0.10.0"
flutter_icons:
android: true
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21 # android min sdk min:16, default 21
And then run this on your terminal (from android studio)
flutter pub run flutter_launcher_icons:main
The command will regenerate icons for android and ios. You can check it in the corresponding folders (eg for android : app/src/main/res/drawable-xxx/ic_launcher)
If you are coming from the future and you have difficulty using the flutter_launcher_icons package.
In July 2022, I tried using the flutter_launcher_icons package (version: "^0.9.2") but it did not work when running the
flutter pub run flutter_launcher_icons:main
and got the famous error 255 code.
After a little search on google, I came across this (very short) and followed this article here: https://www.codewithflutter.com/how-to-change-application-launcher-icon-in-flutter/.
This is what I did to get a launcher icon for the devices that my app would run on.
It's a simple 3 step method to change the app launcher icon.
Step 1:
Go to https://appicon.co/ and use select your launcher's image file.
For best results, it should be 1024 x 1024 pixels.
Select the devices for which you would like the app icon to be generated for. Click on the "Generate" button and a zip file would be downloaded.
When you open the downloaded zip file, it would normally contain the "android" and the "Assets.xcassets" folders (assuming you are generating for both android and ios devices).
Step 2:
Changing the icons manually.
This process is just copying and pasting the folders.
For android:
Open the AppIcons\Android folder and copy all the sub folders.
Then go the android\app\src\main\res folder and paste it (replace the existing file to new files).
For ios:
Open the AppIcons folder and copy the Assets.xcassets folder.
Then go the ios/Runner and paste it (replace the existing file to new files).
Step 3:
Run the command flutter run
Thank you!
Related
I have written a Flutter Desktop app for windows and I want to change the name and icon of app. I change icon from windows>runner>resources and I change app name from windows>runner>main.cpp. They look changed when I debug. But when I get a build with command flutter build windows, the .exe coming to my Release folder is still with old name and flutter icon. I also want the .exe coming from build with new icon and name. How can I do it?
For APP Icon
esay way too add app icon use flutter plugin flutter_launcher_icons after add that code in pub.yam file.
dev_dependencies:
flutter_launcher_icons: "^0.10.0"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21
web:
generate: true
image_path: "path/to/image.png"`
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path:"path/to/image.png"
icon_size: 48
if you change window,web ya android application icon just add your icon path on that particular device application.
If you name your configuration file something other than flutter_launcher_icons.yaml or pubspec.yaml you will need to specify the name of the file when running the package.
flutter pub get
flutter pub run flutter_launcher_icons:main -f <your config file name here>
Second Way
go your Project file in that location windows\runner\resources on that resource folder youcan see your window application image change that image with your chossen image.
Change APP Name
You can use plugin rename: ^2.0.1 too change application name
You can change the bundleId and appName in following folders
IOS
Android
MacOS
Linux
Web
Window
you just install that pluging and after you just type command.
that command chage your application name in all device application.
pub global run rename --appname "Network App"
but if you change only particular device app.so you can type that command.
pub global run rename --bundleId com.example.android.app --target
-t, --target Set which platforms to target.
[android, ios, macOS, linux]
Hello experts I am facing very big issue I am made application in 2021 on flutter my application is still live on play store now I need update it, problem is that I updated my android studio flutter version 3.0. Now opening my old project which was made in 2021 after opening it my pubspec.yaml file is missing in the project, I don't no how to recover that file or repair it. They have a lot of dependencies included there is pubspec.lock file available but not pubspec.yaml please please help me i am in big check screen shot below
if i use flutter create command i am getting this errors
You can create a pubspec.yaml file on root directory or open the bottom terminal and try flutter create . it will provide default structure. Now to get pub package, check the import section and add on pubspec.yaml
If you have a backup then paste the pubspec.yaml file from it. Else take a backup of the project. Run flutter create . in the root directory. It will create the pubspec file in the project. Click on configure dart and add the flutter path then run the project. It will throw errors for the packages used manually enter packages in pubspec or you can try flutter pub add <packagename>
When i add Facebook App Events (v 12.3.2) to flutter project i have error in Xcode.
This not help https://stackoverflow.com/questions/67998790/file-not-found-flutter-flutter-h[enter image description here]1
Problem in Xcode
enter image description here
Problem in Android studio when I use flutter run -d
enter image description here
Flutter doctor and flutter doctor -v don't show any issue
try this steps:
Backup Runner folder
Delete the ios folder
Go to a terminal and execute flutter create . in the flutter project folder
Paste your Runner folder back into the ios folder
pod deintegrate in the ios folder
pod install also in the ios folder
flutter clean in the flutter project folder
flutter pub get
flutter run
Please note that if you use firebase you need to re-insert the GoogleService-Info.plist file
I have installed Android Studio and flutter successfully. When I run flutter doctor in command prompt it gives me [all green ticks in these brackets].
The question is that after the creation of a new flutter project on the right-hand side of the screen under the project I am unable to see/locate any dart main file to write code. For further clarification, you can see the attached image below.
Unable to locate the dart file to write code in the project hierarchy:
I have 0 ideas what is still missing in the configuration of Flutter / Android Studio
Well, I figured out why pubspec.yaml and main.dart was not in my project due to the older version of flutter. I downloaded the latest version flutter_windows_2.2.2-stable, created a new flutter project, and included the flutter SDK path of flutter_windows_2.2.2-stable which resolved all my problems. Kindly, make sure whoever wants to start Mobile Application development in Android Studio + Flutter + Dart always download the latest version of everything.
Recent Experiment:
After downloading the latest version of Flutter still, I was unable to get the pubspec.yaml and main.dart files in my Android Studio Project, so the solution is below:
where you have extracted your flutter_windows_2.2.2-stable remember the directory path like E:\src\flutter_windows_2.2.2-stable which is in my scenario.
******************* CMD WORK *******************
Open cmd(Command Prompt) by default you will be in the directory like C:\Users\UserName\
Now go to the path E:\src and to navigate write E: hit enter, now you will be in the E: directory. Write cd E:\src hit enter.
type flutter create project_name ( make sure whenever you withe the name of the project it should be like this my_first_app in this format you name the projects with proper naming convention in flutter [word_word_word_word] ) then hit enter, wait for a while it will create a new flutter project for you including pubspec.yaml and main.dart files + necessary files to be imported.
Reference for naming convention in flutter (https://medium.com/flutter-community/file-and-folder-structure-in-flutter-967b8be3155e#:~:text=Flutter%20doesn't%20have%20a,letters%20and%20underscores%20between%20words.&text=When%20naming%20folders%2C%20you%20want,them%20very%20direct%20and%20clear.)
Right now after the creation of a project(Flutter) in Android Studio you are unable to see/locate the pubspec.yaml and main.dart files use cmd for the project creation which worked in my scenario.
How to Change below Icon in flutter. it is happening in Nokia 8.1.
App Icon in drawer is correct.
Below is my current res folder
If you are intending to have your application be multi-platform, then there is a dart package you can use which takes care of generating launcher icons for both platforms.
You use it like so:
Add dependency to pubspec.yaml file
flutter_launcher_icons: ^0.7.4
In your pubspec.yaml file include the following attributes (based on your desires)
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Make sure to get packages (flutter pub get)
You can read more in the documentation.
Right click on the android folder in the project outline. Go to New > Image Asset. (Try right clicking the android/app folder if you don't see Image Asset as an option.) Now you can select an image to create your launcher icon from.
This will replace the current launcher icons. You can find the generated icons in the mipmap folders: