flutter - 无法编译:升级到 Flutter 1.7.8+hotfix.4 后的依赖问题
问题描述
这是我在 stackoverflow 上发布的第一个问题,所以如果我需要包含更多信息或指南,请告诉我。刚刚加入一个项目并将我的颤振升级到 1.7.8+hotfix.4。似乎该项目是在以前的版本上运行的(可能是颤振:)">=1.5.0 <1.5.9"
,当我去运行颤振项目时,我会收到一条编译器消息。
从编译器消息看来,受影响的三个包是flutter_advanced_networkimage
, flutter_widget_from_html
, flutter_svg
. 我正在运行的这些软件包的版本如下。
dependencies:
flutter_svg: any
flutter_advanced_networkimage: 0.4.15
flutter_widget_from_html: 0.2.1+1
提前致谢!
这是我收到的编译器消息。
Compiler message:
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/svg.dart:158:18: Error: The argument type 'String' can't be assigned to the
parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'picture failed to precache',
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:335:20: Error: The argument type 'String' can't be
assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'while resolving a picture',
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:337:33: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer information) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:432:31: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer information) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:495:31: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer information) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:559:31: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer information) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:256:16: Error: The argument type 'String' can't be
assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: context,
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:301:18: Error: The argument type 'String' can't be
assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'resolving a single-frame picture stream',
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:399:35: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer buff) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:408:22: Error: The argument type 'String' can't be
assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'in _Element.clipPath',
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:798:31: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer buff) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:809:18: Error: The argument type 'String' can't be
assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'in parseSvgElement',
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/flutter_advanced_networkimage.dart:149:29: Error: The
argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer information) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/flutter_advanced_networksvg.dart:106:29: Error: The
argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer information) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-1.5.3/lib/flare.dart:1028:18: Error: The argument type 'Int32List' can't be assigned to
the parameter type 'Uint16List'.
- 'Int32List' is from 'dart:typed_data'.
- 'Uint16List' is from 'dart:typed_data'.
Try changing the type of the parameter, or casting the argument to 'Uint16List'.
indices: _indices, textureCoordinates: _uvBuffer);
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:8:32: Error: The argument type 'String' can't be
assigned to the parameter type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
context: 'in $methodName',
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:10:29: Error: The argument type 'Null
Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
- 'StringBuffer' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
informationCollector: (StringBuffer buff) {
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:254:33: Error: The argument type
'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart'
('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
_imageStream.removeListener(_updateImage);
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:303:49: Error: The argument type
'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart'
('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
return oldImageStream?.removeListener(_updateImage);
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:325:38: Error: The argument type
'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
- 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/painting/image_stream.dart').
- 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart'
('file:///Users/kawynfurstoss/code/flutter/packages/flutter/lib/src/painting/image_stream.dart').
Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
oldImageStream?.removeListener(_updateImage);
^
file:///Users/kawynfurstoss/code/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:326:46: Error: No named
parameter with the name 'onError'.
_imageStream.addListener(_updateImage, onError: _catchBadImage);
解决方案
推荐阅读
- php - 在 WooCommerce 中隐藏未登录用户的特定产品
- javascript - 清除 Javascript 画布上的文本
- java - 在 Java Spring-Boot 上启动 ApplicationContext 时出错
- c# - 文本框文本到达文本框末尾时“消失”
- javascript - 是否可以从 .wav 文件创建 MediaStream?
- python - 无法理解 uniform_filter1d() 函数的工作原理(从 scipy.ndimage.filters 导入)
- java - RDF4j .ttl 文件过滤器 IF 语句
- python-3.x - 尝试使用烧瓶构建应用程序,但在提交按钮时出现 404 页面未找到错误
- javascript - 链接 .then 而不依赖于先前的结果
- xamarin - ObservableCollection 不在 CodeBehind 中绑定