VSCode找不到Flutter SDK的路径 [英] VSCode Can't Find the PATH To the Flutter SDK

查看:1102
本文介绍了VSCode找不到Flutter SDK的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚尝试执行Flutter:New Project,但是它显示错误找不到flutter SDK. 我已经确保完成Flutter Doctor的所有要求.

I just tried to execute Flutter:New Project, but it shows error could not find a flutter SDK. I've ensure to complete all of requirements from flutter doctor.

有什么办法可以解决这个问题?

Is there any way to solve this problem ?

谢谢.

推荐答案

macOS 上,通过执行以下步骤可以解决此问题.

On macOS this was solved by following these steps.

首先找到在哪里下载fld sdk(可以从此处下载) ).除非您选择其他位置,否则它应该在您的下载文件夹中.

First find where you downloaded the flutter sdk (Can be downloaded from here). It should be in your downloads folder unless you selected somewhere else.

下一步:

  1. 打开终端.运行以下命令:sudo nano/etc/paths
  2. 在出现提示时输入密码.
  3. 转到文件底部,然后输入要添加的路径.
  4. 按Control-x退出.
  5. 输入"Y"以保存修改后的缓冲区.
  1. Open up Terminal. Run the following command: sudo nano /etc/paths
  2. Enter your password, when prompted.
  3. Go to the bottom of the file, and enter the path you wish to add.
  4. Hit control-x to quit.
  5. Enter "Y" to save the modified buffer.

如果sdk已下载到下载"文件夹中,则要添加的路径应该为/Users/yourusername/Downloads/flutter/bin

If the sdk is downloaded into your Downloads folder, your path to add should be /Users/yourusername/Downloads/flutter/bin

最后,退出并重新启动终端窗口和VS Code.重新启动后,两个应用程序均应识别出抖动,并且正在运行的Flutter Doctor现在应该可以工作.

Lastly, quit and restart your terminal windows and VS Code. After restarting, both apps should recognize flutter and running flutter doctor should now work.

这篇关于VSCode找不到Flutter SDK的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆