开发者社区> 问答> 正文

当我运行flutter项目时,请帮助我得到此错误我的系统ubuntu

./../../../Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/cached_network_image-1.1.3/lib/src/cached_network_image_provider.dart:42:24: 

Error: The method 'CachedNetworkImageProvider.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.

方法

ImageStreamCompleter load(CachedNetworkImageProvider key) {
                       ^
../../../../Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: 

Context: This is the overridden method ('load').
  ImageStreamCompleter load(T key, DecoderCallback decode);
                   ^


Target kernel_snapshot failed: Exception: Errors during snapshot creation: null

构建失败。

失败:

Build failed with an exception.

* Where:
Script '/home/omelnour/Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/omelnour/Android/flutter_linux_v1.12.13+hotfix.5-stable/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 7s
Finished with error: Gradle task assembleDebug failed with exit code 1

展开
收起
祖安文状元 2020-01-16 17:47:21 1682 0
1 条回答
写回答
取消 提交回答
  • 这是较旧版本的cached_network_image的问题只需更新到最新版本的cached_network_image 是2.0.0,因此在pubspec.yaml文件中

    cached_network_image: ^1.1.3 用2.0.0更改1.1.3

    2020-01-16 17:47:26
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
基于flutter的产品应用实践 立即下载
《Flutter in action》 立即下载
闲鱼《Flutter 技术解析与实战》 立即下载