0

我正在尝试使用flutter flutter_launcher_icons插件的错误来更改启动器图标。在我替换文件夹中的图标之前,但这次我想使用为此制作的插件,但运行时出现错误:

flutter pub run flutter_launcher_icons:main

这是错误:

    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  

我试图修改写作中的空格,但没有任何改变。

我认为设置起来会更容易,但我找不到错误。

谢谢您的帮助

4

1 回答 1

1

1.设置配置文件

将您的徽标文件(例如:logo.png)添加到资产文件夹中,您必须先创建该文件夹

在你的 pubspec.yaml 中添加 flutter_launcher_icons 包 在你的包的 pubspec.yaml 中添加这样一行

dev_dependencies:
  flutter_launcher_icons: ^0.9.2 
    
flutter_icons:
  android: true
  ios: true
  iamge_path: "assets/logo.png"

2.运行包

设置好配置后,剩下要做的就是在终端中运行包。

flutter pub get
flutter pub run flutter_launcher_icons:main
于 2022-01-17T08:19:40.560 回答