firebase - Flutter 构建错误。(与 pub-cache 相关)
问题描述
当我尝试构建我的项目时,我在控制台中打印了这个错误。
两天前一切正常。
这是错误,
Running "flutter pub get" in SampleApp...
Launching lib\main.dart on Android SDK built for x86 in debug mode...
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/top_level.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.2/lib/js.dart:8:1: Error: Not found: 'dart:js'
export 'dart:js' show allowInterop, allowInteropCaptureThis;
^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.2/lib/js_util.dart:8:1: Error: Not found: 'dart:js_util'
export 'dart:js_util';
^
/E:/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 {
^^^^^^^^^^^^^^^^^^^
/E:/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 {
^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'E:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\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 4m 13s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
我真的不知道为什么会这样,我尝试谷歌搜索但找不到任何有用的东西。
还有更多与 .pub-cache 相关的错误,但我没有发布它,因为那样问题就太长了。
请帮忙。
解决方案
错误在“Firebase”包中,删除它,它就可以工作了。
推荐阅读
- sql - Postgres 对数组或 string_agg 执行聚合
- excel - phpspreadsheet与变量合并错误
- azure-devops - 我希望 Azure Pipeline 构建与刚刚构建的触发管道相同命名的分支
- scala - 如何使用火花统计数据?
- ios - 下载带有“授权”标题的文件时出现 400 错误
- google-apps-script - UrlFetchApp fetchAll 的配额
- unity3d - 如何更改对象被实例化的中心的距离/半径
- angular - chromedriver 未知错误:无法为用户数据目录创建临时目录 (80.0.3987.16)
- keras - Keras:使用生成器输出训练集批次和目标,以及不用于训练的辅助数据
- wpf - WPF,将焦点设置在 TabControl 的内容上