android - lib/home.dart:2:8: 错误:未找到:'dart:html'
问题描述
我是新来的,面临着 Android 工作室的问题。我尝试运行 main.dart(ios 和 android)并收到此警告消息
** 构建失败 **
↳
Invalid depfile: /Users/przemek/AndroidStudioProjects/get_stared_app/.dart_tool/flutter_build/a0939d4e94e10e87373caa81ce1cf2b7/kernel_snapshot.d
Invalid depfile: /Users/przemek/AndroidStudioProjects/get_stared_app/.dart_tool/flutter_build/a0939d4e94e10e87373caa81ce1cf2b7/kernel_snapshot.d
Invalid depfile: /Users/przemek/AndroidStudioProjects/get_stared_app/.dart_tool/flutter_build/a0939d4e94e10e87373caa81ce1cf2b7/kernel_snapshot.d
Invalid depfile: /Users/przemek/AndroidStudioProjects/get_stared_app/.dart_tool/flutter_build/a0939d4e94e10e87373caa81ce1cf2b7/kernel_snapshot.d
lib/home.dart:2:8: Error: Not found: 'dart:html'
import "dart:html";
^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ahtml; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
#1 asFileUri (package:vm/kernel_front_end.dart:659:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:853:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:574:15)
<asynchronous suspension>
#4 _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:43:22)
#5 starter (package:flutter_frontend_server/server.dart:182:27)
#6 main (file:///b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:9:30)
#7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')```
What should I do to fix it? Many thanks for the help in the advance. I updated my Andorid studio this morning and since that time I have this issue
解决方案
尝试用dart:html
main.dartdart:io
文件顶部的替换。
推荐阅读
- kotlin - Kotlin 中是否有任何等效的 C# Guid.Empty?
- tcp - 具有最高 RTT 的 TCP ACK
- ruby-on-rails - ActiveAdmin & 设计用户注册
- django - 如何在Django中获取同一类别中的所有帖子
- swift - 使用 Vapor 3 创建和使用游标
- c++ - C ++如何从内存中删除临时节点模式(以修复泄漏)并仍然在“键”列表中维护节点?
- c# - 编码的 UI C#:将动态日期添加到数据表
- php - PHP递归目录迭代器分块
- javascript - 用嵌套键和日期键合并对象的最有效方法是什么?
- reactjs - 测试来自 jest 模拟事件回调的返回值