gradle 'D:\flutter'未被识别为内部或外部命令、可操作程序或批处理文件

mm9b1k5b  于 2022-12-13  发布在  Flutter
关注(0)|答案(3)|浏览(173)

在调试模式下启动SM A908N上的lib\main.dart ... lib\main.dart:1“D:\flutter”未被识别为内部或外部命令、可操作程序或批处理文件。异常:Gradle任务assembleDebug失败,退出代码为1已退出(sigterm)

4nkexdtk

4nkexdtk1#

根据flutter安装,它安装在C:\src\flutter\bin中,如果您在此位置C:\src\flutter\bin中发现flutter,则转到环境变量,并在此之后将路径设置为C:\src\flutter\bin关闭所有您的终端重新启动您的PC以确保然后运行flutter doctor在终端中,这可能会帮助您开始。

4ioopgfo

4ioopgfo2#

Methods1: Find out the Location of Flutter SDK
Our SDK location at: C:\Users\username\flutter. Now you have to edit the Environment path variable and add new path with “bin/”. Like this: C:\Users\username\flutter\bin

  1. Go to My Computer Properties > Advance System Setting > Environment Variables
    Go to this path and edit the path variable. Now add a new path of your Flutter SDK with “bin\” folder. Like this: C:\Users\rony\flutter\bin.

Now save the changes and restart your terminal. Then open the command box and write below :

flutter doctor

This is how you can solve the Flutter is not recognized as an internal and external command.
Learn More from this article: Flutter is not recognized as an internal and external command

pcww981p

pcww981p3#

您设置了错误的flutter路径,路径应为“D:\flutter\bin”

相关问题