[英]I get the following error when i build my project in flutter
C:\Users\Faheem\Desktop\dashboard>flutter build apk --profile C:\Users\Faheem\Desktop\dashboard>flutter build apk --profile
Building with sound null safety建筑用音响 null 平安
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:2:8: Error: Not found: 'dart:html' import 'dart:html'; /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:2:8: 错误: 未找到: 'dart:html' import 'dart :html'; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.6.2/lib/firebase_core_web.dart:9:8: Error: Not found: 'dart:html' import 'dart:html';
^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.6.2/lib/firebase_core_web.dart:9:8: 错误:未找到:'dart:html' import 'dart: HTML'; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-3.3.13/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:7:8: Error: Not found: 'dart:html' import 'dart:html';
^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-3.3.13/lib/src/firebase_auth_web_recaptcha_verifier_factory.dart:7:8: 错误:找不到:'dart:html' import '飞镖:HTML'; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:2:8: Error: Not found: 'dart:html' import 'dart:html';
^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:2:8: 错误:未找到:'dart:html' import '飞镖:HTML'; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.6.2/lib/firebase_core_web.dart:10:8: Error: Not found: 'dart:js' import 'dart:js';
^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.6.2/lib/firebase_core_web.dart:10:8: 错误:未找到:'dart:js' import 'dart: js'; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js.dart:8:1: Error: Not found: 'dart:js' export 'dart:js' show allowInterop, allowInteropCaptureThis;
^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js.dart:8:1: 错误:未找到:'dart:js' export 'dart: js' show allowInterop, allowInteropCaptureThis; ^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/js_url_strategy.dart:13:8: Error: Not found: 'dart:html' import 'dart:html' as html;
^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/js_url_strategy.dart:13:8: 错误:未找到:'dart:html' import 'dart:html' as html; ^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:6:8: Error: Not found: 'dart:html' import 'dart:html' as html;
^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:6:8: 错误:未找到:'dart:html' import 'dart:html' as html; ^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:5:8: Error: Not found: 'dart:html'
^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:5:8: 错误:未找到:'dart:html'
import 'dart:html';导入“飞镖:html”; ^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js_util.dart:8:1: Error: Not found: 'dart:js_util' export 'dart:js_util';
^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/lib/js_util.dart:8:1: 错误:未找到:'dart:js_util' export 'dart: js_util'; ^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/js_url_strategy.dart:79:48: Error: Type 'html.EventListener' not found.
^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/js_url_strategy.dart:79:48:错误:未找到类型“html.EventListener”。 external ui.VoidCallback addPopStateListener(html.EventListener fn);
外部 ui.VoidCallback addPopStateListener(html.EventListener fn); ^^^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:194:3: Error: Type 'html.Location' not found.
^^^^^^^^^^^^^^^^^^/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:194:3: 错误:输入 'html.Location'未找到。 html.Location get _location => html.window.location;
html.Location get _location => html.window.location; ^^^^^^^^^^^^^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:196:3: Error: Type 'html.History' not found.
^^^^^^^^^^^^^/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:196:3: 错误:找不到类型 'html.History'。 html.History get _history => html.window.history;
html.History get _history => html.window.history; ^^^^^^^^^^^^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:199:28: Error: Type 'html.EventListener' not found.
^^^^^^^^^^^^/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:199:28: 错误:找不到类型 'html.EventListener'。 void addPopStateListener(html.EventListener fn) { ^^^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:204:31: Error: Type 'html.EventListener' not found.
void addPopStateListener(html.EventListener fn) { ^^^^^^^^^^^^^^^^^^/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart:204:31 :错误:找不到类型“html.EventListener”。 void removePopStateListener(html.EventListener fn) { ^^^^^^^^^^^^^^^^^^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:7:7: Error: Type 'AnchorElement' not found.
void removePopStateListener(html.EventListener fn) { ^^^^^^^^^^^^^^^^^^/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:7:7 :错误:未找到类型“AnchorElement”。 final AnchorElement _urlParsingNode = AnchorElement();
最后的 AnchorElement _urlParsingNode = AnchorElement(); ^^^^^^^^^^^^^ /C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:20:7: Error: Type 'Element' not found.
^^^^^^^^^^^^^/C:/flutter/packages/flutter_web_plugins/lib/src/navigation/utils.dart:20:7: 错误:找不到键入“元素”。 final Element?
最终元素? _baseElement = document.querySelector('base');
_baseElement = document.querySelector('base'); ^^^^^^^../../runtime/vm/zone.cc: 94: error: Out of memory. version=2.16.2 (stable) (Tue Mar 22 13:15:13 2022 +0100) on "windows_x64" pid=3640, thread=8308, isolate_group=main(00000000053F0BE0), isolate=(nil)(0000000000000000) isolate_instructions=3e90000, vm_instructions=7ff6304d5460
^^^^^^^../../runtime/vm/zone.cc: 94: error: Out of memory.version=2.16.2 (stable) (Tue Mar 22 13:15:13 2022 +0100)在“windows_x64”上 pid=3640,thread=8308,isolate_group=main(00000000053F0BE0),isolate=(nil)(0000000000000000)isolate_instructions=3e90000,vm_instructions=7ff6304d5460
pc 0x00007ff6306dd222 fp 0x000000000a36eb20 Dart_IsPrecompiledRuntime+0x21cd22 -- End of DumpStackTrace === Crash occured when compiling package:front_end/src/fasta/kernel/hierarchy/hierarchy_node.dart_ClassHierarc* What went wrong: Execution failed for task ':app:compileFlutterBuildProfile'. pc 0x00007ff6306dd222 fp 0x000000000a36eb20 Dart_IsPrecompiledRuntime+0x21cd22 -- End of DumpStackTrace === Crash occured when compiling package:front_end/src/fasta/kernel/hierarchy/hierarchy_node.dart_ClassHierarc* What went wrong: Execution failed for task ':app:compileFlutterBuildProfile'.
Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
处理 'command 'C:\flutter\bin\flutter.bat'' 以非零退出值 1 完成
Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. Run with --scan to get full insights.
使用 --info 或 --debug 选项运行以获取更多日志 output。使用 --scan 运行以获取完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获得更多帮助
Try these commands:试试这些命令:
flutter clean
flutter packages get
dart pub get
If this doesn't solve your problem, I recommend starting a new project and moving your code and pubspec.yaml files there.如果这不能解决您的问题,我建议开始一个新项目并将您的代码和 pubspec.yaml 文件移到那里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.