[英]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.