gpt4 book ai didi

android - 在 Android Studio 中构建文件时出现 flutter 错误

转载 作者:行者123 更新时间:2023-12-03 02:55:18 25 4
gpt4 key购买 nike

我在 Android Studio 上新安装了 Flutter。我有一个 flutter 的源代码,我想用它打开。我安装了最新的flutter插件和flutter SDK。但是当我尝试运行该应用程序时,它显示了以下错误:

Compiler message:
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
PictureStream();
^^^^^^^^^^^^^
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
^

Compiler message:
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
PictureStream();
^^^^^^^^^^^^^
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Flutter SDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Flutter SDK\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 23s
Exception: Gradle task assembleDebug failed with exit code 1

我对此完全陌生,不知道此错误指向何处。我有最新的 Flutter SDK 版本:Flutter 1.17.0 和 Dart 2.8.1,这是一个稳定版本。我的 Android Studio 版本是 3.6.2

最佳答案

尝试在您的终端中执行此操作:
flutter pub cache repair
如果它不起作用,删除 flutter 文件夹以及缓存文件夹应该可以完成这项工作。

关于android - 在 Android Studio 中构建文件时出现 flutter 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61663167/

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