当我试图用"flutter_launcher_icons 0.9.2“更改应用程序图标时,我得到了这个错误。我试过指定minsdk和targetsdk的应用程序,但这不起作用,我已经做过几次颤栗酒吧了。在那之后,当我这样做的时候:颤栗酒吧运行flutter_launcher_icons:main。我知道这个错误
这是我的pubspec.yaml:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.9.2
flutter_icons:
android: true
ios: true
image_path: "dev_assets/news-logos.jpeg"
adaptive_icon_background: "#FFFFFF"
adaptive_icon_foreground: "dev_assets/news-logos.jpeg"我的android/应用程序/build.gradle:
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.news_app"
minSdkVersion 21
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}完全错误:
✓ Successfully generated launcher icons
Unhandled exception:
FileSystemException: Cannot open file, path = 'dev_assets/news-logos.jpeg' (OS Error: The system cannot find the path specified.
, errno = 3)
#0 _File.throwIfError (dart:io/file_impl.dart:635:7)
#1 _File.openSync (dart:io/file_impl.dart:479:5)
#2 _File.readAsBytesSync (dart:io/file_impl.dart:539:18)
#3 decodeImageFile (package:flutter_launcher_icons/utils.dart:35:44)
#4 createDefaultIcons (package:flutter_launcher_icons/android.dart:35:24)
#5 createIconsFromConfig (package:flutter_launcher_icons/main.dart:103:28)
#6 createIconsFromArguments (package:flutter_launcher_icons/main.dart:60:7)
#7 main (file:///D:/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.2/bin/main.dart:6:26)
#8 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
pub finished with exit code 255发布于 2022-03-19 23:05:19
这似乎是窗口错误。我没有什么解决办法
news-logos.jpeg并复制相对路径,然后粘贴到任何需要它的地方。dev_assets/news-logos.jpeg更改为dev_assets\news-logos.jpeg,因为windows不使用/发布于 2022-03-24 17:05:01
目前图标只支持PNG图像格式,所以在您的应用程序中可能会出现这个问题。尝试添加PNG图像。
发布于 2022-03-19 19:07:21
读取错误时,文件的路径不正确。
https://stackoverflow.com/questions/71539645
复制相似问题