【问题标题】:Probleme with flutter launcher icons颤振启动器图标有问题
【发布时间】:2019-10-06 14:26:45
【问题描述】:

我需要有关依赖项 flutter_launcher_icons 的帮助:^0.7.0, 我希望从 in.png 中的图像向我的应用程序插入一个图标

使用旧程序,该命令可以完美运行。 我更改了文件夹,创建了一个新的 Flutter 项目,但没有任何效果。 我也做了一个干净的flutter,没有成功

我执行了颤振医生-v,一切都很好。

如果格式不完美,请原谅,这是我在这里问的第一个问题

提前感谢您的帮助

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:207:45:错误:Getter not发现:“平均”。 newFile = copyResize(image, e.size, -1, AVERAGE); ^^^^^^^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:207:25:错误:太多位置参数:允许 1 个,但找到 4 个。 尝试删除额外的位置参数。 newFile = copyResize(image, e.size, -1, AVERAGE); ^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.0/lib/src/transform/copy_resize.dart:14:7:背景:找到了这个候选人,但论据不匹配。 Image copyResize(Image src, {int width, int height, ^^^^^^^^^^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:209:45:错误:Getter not发现:“线性”。 newFile = copyResize(image, e.size, -1, LINEAR); ^^^^^^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:209:25:错误:太多位置参数:允许 1 个,但找到 4 个。 尝试删除额外的位置参数。 newFile = copyResize(image, e.size, -1, LINEAR); ^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.0/lib/src/transform/copy_resize.dart:14:7:背景:找到了这个候选人,但论据不匹配。 Image copyResize(Image src, {int width, int height, ^^^^^^^^^^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:223:63:错误:Getter not发现:“平均”。 newFile = copyResize(image, template.size, template.size, AVERAGE); ^^^^^^^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:223:25:错误:太多位置参数:允许 1 个,但找到 4 个。 尝试删除额外的位置参数。 newFile = copyResize(image, template.size, template.size, AVERAGE); ^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.0/lib/src/transform/copy_resize.dart:14:7:背景:找到了这个候选人,但论据不匹配。 Image copyResize(Image src, {int width, int height, ^^^^^^^^^^

file:///E:/​​NexToYou/Google/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.7.0/lib/android.dart:226:63:错误:Getter not发现:“线性”。 newFile = copyResize(image, template.size, template.size, LINEAR); ^^^^^^

发布结束,退出代码为 1enter image description here

strong text**

【问题讨论】:

  • “使用旧程序”是什么意思?
  • “旧程序”是指一两周前的程序

标签: flutter dependencies


【解决方案1】:

将这两行添加到您的 pubspec.yaml

dependency_overrides:
  image: 2.0.7

flutter_launcher_icons 似乎与最新版本的镜像 2.1.0 不兼容。较低版本的图像作品。 issue#102

【讨论】:

  • 您好,感谢您的回答,抱歉耽搁了。我通过添加 2 行尝试了您的方法,但不幸的是它不起作用。始终显示相同的错误。我试图将它添加到 flutter_launcher_icons 下方的依赖项中,但它没有改变任何东西。我必须将映像版本从 2.0.7 更改为 2.1.1,否则 flutter packages get 命令不起作用。
  • “dependency_overrides:”之前有缩进吗?它应该与“依赖项:”(不在它之下)处于同一级别
  • 它不起作用,我尝试了不同的方式:我试图将图像直接放入依赖项中,它不起作用。我试图将 dependencies_overrides 放在依赖项中,并且在下面,它不起作用。我尝试添加破折号,但也没有。我也尝试在 dependencies_overrides: image:">=2.1.3" 中这样写
【解决方案2】:

解决方法

flutter_launcher_icons: "0.7.3"

【讨论】:

    【解决方案3】:

    在 2021 年 6 月,我通过升级到 flutter_launcher_icons: "^0.9.0" 来修复它。快乐编码! 我创建了一个帖子,其中包含有关此的更多详细信息。 https://betterprogramming.pub/2-ways-to-add-app-launcher-icons-in-flutter-e9fce30bc177

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-26
      • 2022-11-10
      • 2020-10-16
      • 2021-01-30
      • 1970-01-01
      • 2021-08-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多