升级后无法在Flutter 1.12.13 + hotfix.5中构建我的应用

时间:2019-12-18 18:16:11

标签: flutter dart

我正在开发应用程序,并且一切都按计划进行,然后我将内容升级了到最新版本。

我尝试过颤抖的医生-v ,一切看起来都

这是我尝试构建应用程序时收到的错误消息:

Compiler message:
/C:/src/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) {
                       ^
/C:/src/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.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' 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 19s

2 个答案:

答案 0 :(得分:1)

Flutter似乎在this commit中添加了DecoderCallback,现在它是load函数的必需参数。查看您使用的cached_network_image依赖项,此问题已在其README.md中指出:

  

如果遇到以下错误之一,请升级到2.0.0-rc。

因此,您可以通过升级cached_network_image中的pubspec.yml来解决此问题。

答案 1 :(得分:1)

我认为问题出在cached_network_image上。查看文档。我相信您需要使用此版本- cached_network_image:^ 2.0.0-rc