admin管理员组文章数量:1287838
i just started this week again with dart/flutter and wanted to change my launcher icons, i tried allot of tutorials but i keep getting the following error`s.
This is my pubspec.yaml
dependencies:
water_drop_nav_bar:
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.8
flutter_launcher_icons: ^0.14.3
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21
web:
generate: true
image_path: "assets/icon/icon.png"
background_color: "#FFFFFF" # White background
theme_color: "#007BFF" # Blue theme color
windows:
generate: true
image_path: "assets/icon/icon.png"
icon_size: 48
macos:
generate: true
image_path: "assets/icon/icon.png"
and i will get the following error,
• Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
⚠️PathNotFoundException: Cannot open file, path = '.\path/to/image.png' (OS Error: The system cannot find the path specified.
, errno = 3)
Creating Icons for Windows...
⚠️.\path/to/image.png this file or folder is required to generate web icons
⚠️Requirements failed for platform Windows. Skipped
Creating Icons for MacOS...
⚠️PathNotFoundException: Cannot open file, path = '.\path/to/image.png' (OS Error: The system cannot find the path specified.
, errno = 3)
i tried:
flutter pub clean flutter pub get flutter pub run flutter_launcher_icons
but i still will get the errors
sorry for my probably simple error i just want to learn and improve myself
i just started this week again with dart/flutter and wanted to change my launcher icons, i tried allot of tutorials but i keep getting the following error`s.
This is my pubspec.yaml
dependencies:
water_drop_nav_bar:
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.8
flutter_launcher_icons: ^0.14.3
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21
web:
generate: true
image_path: "assets/icon/icon.png"
background_color: "#FFFFFF" # White background
theme_color: "#007BFF" # Blue theme color
windows:
generate: true
image_path: "assets/icon/icon.png"
icon_size: 48
macos:
generate: true
image_path: "assets/icon/icon.png"
and i will get the following error,
• Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
⚠️PathNotFoundException: Cannot open file, path = '.\path/to/image.png' (OS Error: The system cannot find the path specified.
, errno = 3)
Creating Icons for Windows...
⚠️.\path/to/image.png this file or folder is required to generate web icons
⚠️Requirements failed for platform Windows. Skipped
Creating Icons for MacOS...
⚠️PathNotFoundException: Cannot open file, path = '.\path/to/image.png' (OS Error: The system cannot find the path specified.
, errno = 3)
i tried:
flutter pub clean flutter pub get flutter pub run flutter_launcher_icons
but i still will get the errors
sorry for my probably simple error i just want to learn and improve myself
Share Improve this question asked Feb 22 at 22:55 zeroxzerox 53 bronze badges1 Answer
Reset to default 2I had this problem with flutter_launcher_icons
package
You can change the icon of the app from the flutter project files
1.For Android
- Go to any android icons generator , I use this android_icon_generator
- Upload the you icon and download the
.zip
file - Unzip the file you will find the
android
file - select all item in this file and copy them
- Go to your Flutter project then to
android/app/src/main/res/
- Replace all the files in this file by pasting them
- run you flutter app you will find the icon changed on the
android
app
2. For Windows
- Go to any windows icons generator , I use this windows_icon_generator
- Upload the you icon and download the
.ico
file - Go to your Flutter project then to
windows/runner/resources/
- You will find the default flutter icon
- Delete it and past you icon
.ico
- It very important to rename the new icon with
app_icon
- run you flutter app you will find the icon changed on the windows app
3. For IOS:
- Go to any IOS icon generator, I use this with ios option: ios_icon_generator
- Upload the you icon and download the
.zip
file - Unzip the file you will find the
AppIcon.appiconset
file - select all item in this file and copy them
- Go to the
ios/Runner/Assets.xcassets/AppIcon.appiconset
directory in your Flutter project. - Replace all the files in this file by pasting them
- Open the
Contents.json
file in theAppIcon.appiconset
folder. - Normally the generator update
Contents.json
,but in case, - Ensure the
filename
fields in theJSON file
match the names of your new icons.
4. For macOS:
- Go to any
macos
icon generator, I use this withmacos
option: macos_icon_generator - Upload the you icon and download the
.zip
file - Unzip the file you will find the
AppIcon.appiconset
file - Select all item in this file and copy them
- Go to the
macos/Runner/Assets.xcassets/AppIcon.appiconset
directory in your Flutter project. - Replace all the files in this file by pasting them
- Open the
Contents.json
file in theAppIcon.appiconset
folder. - Normally the generator update
Contents.json
,but in case, - Ensure the
filename
fields in theJSON file
match the names of your new icons.
On ios
&& macos
the Contents.json
should look like this :
idoim
is iphone
for ios
and mac
for macos
{
"images": [
{
"size": "60x60",
"expected-size": "180",
"filename": "180.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "iphone",
"scale": "3x"
},
{
"size": "40x40",
"expected-size": "80",
"filename": "80.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "iphone",
"scale": "2x"
},
.....
]
}
5. For Web:
- Go to this website to generate the web icons :web_icon_generator
- Upload your
.png
image press Create Favicon and download the.zip
file - Unzip the file you will find the
manifest.json
file and you icons with diffrent sizes copy them - Go to the
web/icons
directory in your Flutter project - Replace the icons of
icons
file with the generated icons - Replace the
manifest.json
file also and thefavicon
but do not touch theindex.html
file. - Open the
web/index.html
file in your flutter project. - Add this code which generated by the favicon
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
- Sometimes the generator do not create the
manifest.json
complete so please ensure that every thing is complete
{
"name": "APP_NAME",
"short_name": "APP_NAME",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "\/icons/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/icons/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/icons/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/icons/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/icons/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/icons/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
After every thing run these commands :
flutter clean
flutter pub get
And when you build any release of theme android
, windows
, ios
, macos
or web
the icon should be changed
Hope that was helpful for you !!
本文标签: dartFlutter launcher wont runStack Overflow
版权声明:本文标题:dart - Flutter launcher wont run - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741324765a2372409.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论