gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 04:26:39 25 4
gpt4 key购买 nike

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

我尝试过 flutter doctor -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

最佳答案

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

If you are experiencing one of the following errors upgrade to 2.0.0-rc.



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

关于flutter - 升级后无法在Flutter 1.12.13 + hotfix.5中构建我的应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59397956/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com