Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置后安装app 图标是一个黑块 #625

Open
403914291 opened this issue Jan 9, 2025 · 4 comments
Open

配置后安装app 图标是一个黑块 #625

403914291 opened this issue Jan 9, 2025 · 4 comments
Labels

Comments

@403914291
Copy link

ℹ️ Info

flutter_launcher_icons: ^0.14.2

💬 Description

step1 :
在pubspec.yaml 文件中添加 flutter_launcher_icons: ^0.14.2 然后执行 flutter pub get
step2:
在pubspec.yaml 文件中添加配置flutter_launcher_icons 配置信息如下:
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21
remove_alpha_ios: true
step3: 生成配置文件执行命令

   dart run flutter_launcher_icons:generate

LOG:

 ly@LYdeMacBook-Pro-2 mydemo5 %  dart run flutter_launcher_icons:generate

Building package executable...
Built flutter_launcher_icons:generate.
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.14.2)
════════════════════════════════════════════

Config file generated successfully 🎉
You can now use this new config file by using the command below:

flutter pub run flutter_launcher_icons

step4: 生成图标执行命令

      flutter pub run flutter_launcher_icons
    
  LOG:

LYdeMacBook-Pro-2 mydemo5 % dart run flutter_launcher_icons
Building package executable...
Built flutter_launcher_icons:flutter_launcher_icons.
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.14.2)
════════════════════════════════════════════

• Creating default icons Android
• Adding a new Android launcher icon
• Creating mipmap xml file Android

WARNING: Icons with alpha channel are not allowed in the Apple App Store.
Set "remove_alpha_ios: true" to remove it.

• Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
⚠️PathNotFoundException: Cannot open file, path = './path/to/image.png' (OS Error: No such file or directory, errno = 2)
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: No such file or directory, errno = 2)

✓ Successfully generated launcher icons

📜 Pubspec.yaml

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"
  min_sdk_android: 21
  remove_alpha_ios: true
@403914291 403914291 added the bug label Jan 9, 2025
@403914291
Copy link
Author

这是执行dart run flutter_launcher_icons:generate命令生成的文件,
问题1: image_path: "assets/icon/icon.png" 这个路径生成总是这个地址,不管如何修改 pubspace.yaml 文件都是如此。
问题2: web , windows ,macos 下的路径path 是指是那里,这里一直找不到文件路径,这个我没有配置,为什么会生成这几个平台的地址?

flutter pub run flutter_launcher_icons

flutter_launcher_icons:
image_path: "assets/icon/icon.png"

android: "launcher_icon"

image_path_android: "assets/icon/icon.png"

min_sdk_android: 21 # android min sdk min:16, default 21

adaptive_icon_background: "assets/icon/background.png"

adaptive_icon_foreground: "assets/icon/foreground.png"

adaptive_icon_monochrome: "assets/icon/monochrome.png"

ios: true

image_path_ios: "assets/icon/icon.png"

remove_alpha_channel_ios: true

image_path_ios_dark_transparent: "assets/icon/icon_dark.png"

image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png"

desaturate_tinted_to_grayscale_ios: true

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 # min:48, max:256, default: 48

macos:
generate: true
image_path: "path/to/image.png"

@403914291
Copy link
Author

@BenVercammen 这个问题是不是我操作出来的,还是这个插件的bug?

@wqb55
Copy link

wqb55 commented Jan 14, 2025

我也遇到了同样的问题,手机桌面图标是纯黑色一块

@wqb55
Copy link

wqb55 commented Jan 14, 2025

已解决,使用命令生成图标后吗,多了个mipmap-anydpi-v26 目录,删掉即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants