gpt4 book ai didi

android - 在Flutter应用程序中获取图片流错误

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

当我运行我的flutter应用程序时,它向我显示了图片流错误,有人可以解决它,我尝试了我可以尝试的所有可能的解决方案。
这是错误

>  D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26:
> Error: Type 'DiagnosticableMixin' not found. class PictureStream with
> DiagnosticableMixin {
> ^^^^^^^^^^^^^^^^^^^ /D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44:
> Error: Type 'DiagnosticableMixin' not found. abstract class
> PictureStreamCompleter with DiagnosticableMixin {
> ^^^^^^^^^^^^^^^^^^^ /D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7:
> Error: The type 'DiagnosticableMixin' can't be mixed in. class
> PictureStream with DiagnosticableMixin {
> ^ /D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16:
> Error: The type 'DiagnosticableMixin' can't be mixed in. abstract
> class PictureStreamCompleter with DiagnosticableMixin


super.debugFillProperties(properties);
^^^^^^^^^^^^^^^^^^^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
- 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('/D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
ifPresent: _completer?.toStringShort(),
^^^^^^^^^^^^^
/D:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(description);
^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\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 55s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

最佳答案

你好Moiz ♂‍♂️
我猜您使用的是flutter_svg软件包,还是以前使用过的软件包。
无论哪种情况,您的pub cache中都有该软件包,并且它的版本与您当前正在运行的Flutter的版本有关。
@BestFastFirethis Github issue中建议的那样,您应该能够通过执行以下任一操作来解决此问题:

如果您的Flutter版本为< 1.20,请使用flutter_svg: 0.17.4如果您的Flutter版本为>= 1.20,请使用flutter_svg: 0.18
PS:刚才我遇到了同样的问题,我通过从发布缓存中删除软件包(flutter_svg)来解决了这个问题。 (因为我没有在当前项目中使用flutter_svg)

可以在以下位置找到Pub软件包,包括flutter_svgC:\Users\<USERPROFILE>\AppData\Local\Pub\Cache\hosted\pub.dartlang.org,如果您想采用这种方法。
别忘了用您的用户名替换🙂

我希望这有帮助。 🙂
如果不是,请检查Github issue以获取更多详细信息。 😎

关于android - 在Flutter应用程序中获取图片流错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63580978/

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