【问题标题】:dart:html is placed inside the file but Error is not found?dart:html 放在文件中但找不到错误?
【发布时间】:2022-01-21 05:24:36
【问题描述】:

我有一个使用 JSON API 的项目工作正常,但在我调试我的应用程序并想要修改时突然出现错误,但是当我重新启动应用程序时,它突然显示以下错误。所需的import 'dart:html'; 已在该文件中。但不知道为什么会这样。我试图import dart.io 但同样的问题。我试图重新启动和 invilidate 缓存,但问题存在。 错误:

Launching lib\main.dart on Infinix X652 in debug mode...
Running Gradle task 'assembleDebug'...
Invalid depfile: E:\Flutter Projects\criclite\.dart_tool\flutter_build\d908c0f5b30e137aa06d363a041f44ee\kernel_snapshot.d
Invalid depfile: E:\Flutter Projects\criclite\.dart_tool\flutter_build\d908c0f5b30e137aa06d363a041f44ee\kernel_snapshot.d
lib/ui/News.dart:6:8: Error: Not found: 'dart:html'
import 'dart:html';

注意:项目运行良好,这个问题突然出现,没有做任何更改。

【问题讨论】:

    标签: html flutter dart


    【解决方案1】:

    请删除导入dart:html 然后扑腾干净 运行将解决问题。

    【讨论】:

    • 问题已解决,谢谢
    • @QasimAli :请将此答案标记为已接受。谢谢。
    猜你喜欢
    • 2020-12-26
    • 2022-09-29
    • 1970-01-01
    • 2021-09-20
    • 1970-01-01
    • 2020-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多