我试图在Android Studio中运行一些代码,但是它一直显示编译错误

时间:2019-08-08 13:19:39

标签: flutter

我试图运行Flutter代码,但它一直显示以下错误。

我尝试更新flutter_svg和cached_network_image的版本,但错误仍然存​​在。

编译器消息: 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:335:20:错误:无法将参数类型'String'分配给参数类型'DiagnosticsNode'。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。           上下文:“在解析图片时”,                    ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:337:33:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。           informationCollector:(StringBuffer信息){                                 ^ file:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:432:31:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。         informationCollector:(StringBuffer信息){                               ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:495:31:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。         informationCollector:(StringBuffer信息){                               ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:559:31:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。         informationCollector:(StringBuffer信息){                               ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:256:16:错误:无法将参数类型'String'分配给参数类型'DiagnosticsNode'。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。       上下文:上下文,                ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:301:18:错误:无法将参数类型'String'分配给参数类型'DiagnosticsNode'。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。         上下文:“解析单帧图片流”,                  ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/svg.dart:158:18:错误:参数类型无法将“字符串”分配给参数类型“ DiagnosticsNode”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。         上下文:“图片无法预缓存”,                  ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:399:35:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。             informationCollector:(StringBuffer buff){                                   ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:408:22:错误:无法将参数类型'String'分配给参数类型'DiagnosticsNode'。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。             上下文:“在_Element.clipPath中”,                      ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:798:31:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。         informationCollector:(StringBuffer buff){                               ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:809:18:错误:无法将参数类型'String'分配给参数类型'DiagnosticsNode'。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。         上下文:“在parseSvgElement中”,                  ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:8:32:错误:无法将参数类型'String'分配给参数类型'DiagnosticsNode'。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ DiagnosticsNode”。       上下文:“在$ methodName中”,                                ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:10:29:错误:参数类型'Null Function(StringBuffer)'不能分配给参数类型'Iterable Function()'。  -“ StringBuffer”来自“ dart:core”。  -“可迭代”来自“ dart:core”。  -'DiagnosticsNode'来自'package:flutter / src / foundation / diagnostics.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/foundation/diagnostics.dart') 。 尝试更改参数的类型,或将参数强制转换为“ Iterable Function()”。       informationCollector:(StringBuffer buff){                             ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/zoomable_image-1.3.1/lib/src/zoomable_image.dart:174:30:错误:参数类型无法将“ void Function(ImageInfo,bool)”分配给参数类型“ ImageStreamListener”。  -'ImageInfo'来自'package:flutter / src / painting / image_stream.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/painting/image_stream.dart') 。  -'ImageStreamListener'来自'package:flutter / src / painting / image_stream.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/painting/image_stream.dart') 。 尝试更改参数的类型,或将参数强制转换为“ ImageStreamListener”。     _imageStream.addListener(_handleImageLoaded);                              ^ 文件:/// C:/flutter%20Dev/flutter/.pub-cache/hosted/pub.dartlang.org/zoomable_image-1.3.1/lib/src/zoomable_image.dart:186:33:错误:参数类型无法将“ void Function(ImageInfo,bool)”分配给参数类型“ ImageStreamListener”。  -'ImageInfo'来自'package:flutter / src / painting / image_stream.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/painting/image_stream.dart') 。  -'ImageStreamListener'来自'package:flutter / src / painting / image_stream.dart'('file:/// C:/flutter%20Dev/flutter/packages/flutter/lib/src/painting/image_stream.dart') 。 尝试更改参数的类型,或将参数强制转换为“ ImageStreamListener”。     _imageStream.removeListener(_handleImageLoaded);                                 ^ 编译器在F:\ Downloads \ weo \ lib \ main.dart上失败 错误完成:Gradle任务assembleDebug失败,退出代码为1

0 个答案:

没有答案