在Android Studio中构建文件时出现Flutter错误 [英] Flutter error on building files in Android Studio
问题描述
我在Android Studio上新安装了Flutter.我有一个flutter的源代码,我想使用它打开.我安装了最新的flutter插件和flutter SDK.但是当我尝试运行该应用程序时,它显示了以下错误:
I have newly installed Flutter on Android Studio. I had a source code of flutter which I want to open using it. I installed the latest flutter plugin and flutter SDK. But when I try to run the app, it shows me the following error:
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
I am completely new to this and have no idea where this error is pointing. I have the latest Flutter SDK version: Flutter 1.17.0 and Dart 2.8.1, it's a stable version. My Android Studio version is 3.6.2
推荐答案
尝试在您的终端中执行此操作:
Try executing this in your terminal :
flutter pub缓存修复
如果不起作用,则应删除flutter文件夹以及缓存文件夹.
If it doesn't work, deleting the flutter folder, along with the cache folder should do the job.
这篇关于在Android Studio中构建文件时出现Flutter错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!