【问题标题】:flutter run -d chrome --release throwing error Missing index.html (Flutter)flutter run -d chrome --release 抛出错误 Missing index.html (Flutter)
【发布时间】:2021-05-28 12:20:43
【问题描述】:

我刚刚从 GitHub 下载了一个项目

(https://github.com/pichillilorenzo/flutter_browser_app)。 当我使用 flutter run -d chrome --release 运行它时,它显示错误

https://drive.google.com/file/d/1cXnLmX-gXeOiI56Cv4oeVcyVFdDlqd02/view?usp=sharing

(我试过这个"$ flutter build web" is throwing the error "Missing index.html"? 但没用)

我可以在 chrome 中运行其他项目

颤振医生的输出

https://drive.google.com/file/d/1cXnLmX-gXeOiI56Cv4oeVcyVFdDlqd02/view?usp=sharing

简而言之,我只想在 chrome 上运行这个项目。

【问题讨论】:

标签: flutter dart flutter-web flutter-test


【解决方案1】:

你可以试试这个方法,效果不错:

  1. 新建一个 Flutter 项目
  2. 现在将旧项目的文件粘贴到新项目中。

这样,新项目就已经配置好了,可以运行了。

【讨论】:

  • 我应该只粘贴 lib 文件夹中的代码还是必须粘贴所有文件
【解决方案2】:

cd 回到项目所在的父目录。

运行flutter创建文件夹名称

这将修复当前项目并添加所有丢失的文件。您可能需要打开您的 pubspec.yaml 文件并 pud get 和 pub upgrade 以使一切恢复正常。

【讨论】:

    猜你喜欢
    • 2020-09-30
    • 2021-07-27
    • 2020-08-02
    • 2021-09-15
    • 2023-01-23
    • 2020-04-24
    • 2023-01-30
    • 1970-01-01
    • 2020-02-19
    相关资源
    最近更新 更多