简体   繁体   English

未找到目标文件“lib\main.dart”。 flutter

[英]Target file "lib\main.dart" not found. flutter

Even I have the file in lib/ folder flutter gives me error即使我有 lib/ 文件夹中的文件 flutter 给我错误

Here is my file这是我的文件

主要飞镖位置 C:\SRC\flutter\packages\flutter_tools>flutter run Target file "lib\main.dart" not found. C:\SRC\flutter\packages\flutter_tools>flutter run 找不到目标文件“lib\main.dart”。

Edit:编辑:

here is my configuration这是我的配置

在此处输入图像描述

I have looked to this topic Getting error like "Target file "lib\main.dart" not found."我已经查看了这个主题出现错误,例如“找不到目标文件“lib\main.dart”。” whlie building APK in flutter 在 flutter 中构建 APK

But this situation is different from mine.但这种情况与我的不同。

Reason:原因:
This is the error because of the main execution starts searching main file, but can't find it.这是因为主执行开始搜索主文件但找不到它的错误。
Solution:解决方案:
Go to Edit Configurations... Go 编辑配置...
在此处输入图像描述
Set here main.dart file as dart entry point here and save it...在此处设置main.dart文件为dart入口点并保存...
在此处输入图像描述
Another Solution另一种解决方案
Run following command运行以下命令
flutter run -t lib/main.dart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 出现“找不到目标文件”lib\main.dart“之类的错误。” 在 flutter 中构建 APK - Getting error like “Target file ”lib\main.dart“ not found.” whlie building APK in flutter Flutter:找不到目标文件“lib/main.dart” - Flutter : Target file "lib/main.dart" not found 更改配置flutter build apk,找不到目标文件“lib/main.dart” - change configuration flutter build apk, Target file "lib/main.dart" not found AndroidStudio:在 main.dart 中找不到入口点文件 - AndroidStudio: Entrypoint file not found at main.dart ZC047B10EEEE763AFB6164E07CF1CC268Z:我更改了Z35900D987289A89A83AF101D18A9F7C3501Z入口处login.zbbbb14127678960e171777897d8739501595015950101595010150150150150101010101010101010101010101010年, - Flutter: I have changed the Dart entrypoint to Login.dart , while building apks error shows that lib\main.dart not found 如何修复 flutter lib/main.dart 错误 - How to fix flutter lib/main.dart errors 归档 flutter 应用程序时在项目中找不到 main.dart - main.dart is not found in project when archiving flutter app Flutter 在 main.dart 文件中添加提供程序的更好方法 - Flutter Better way to add Providers in main.dart file flutter 项目中的根文件(main.dart)在哪里? - Where is the root file(main.dart) in a flutter project located? Flutter 显示 Expected to find ','。 在 main.dart 文件中 - Flutter is showing Expected to find ','. in main.dart file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM