这里的行为很奇怪
flutter doctor 首先打印两行,例如:
The system cannot find the specified path
The system cannot find the specified path
但继续工作:
[√] Flutter (Channel master, v1.12.16-pre.35, on Microsoft Windows [Version 10.0.14393], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.5)
[√] VS Code (version 1.40.2)
[√] Connected device (3 available)
• No issues found!
问题是当我在 vs code 终端中运行应用程序时停止并只显示
系统找不到指定的路径
但是 android studio 可以毫无问题地完成这项工作
我需要 VS Code 中的实时共享功能,所以我也需要这个 IDE 才能工作(不幸的是)
在 vs code 中运行 flutter run 后完成终端日志:
The system cannot find the path specified.
The system cannot find the path specified.
Launching lib\main.dart on LG M700 in debug mode...
Initializing gradle... -
Sending crash report to Google.
Crash report sent (report ID: 5e6da0b57190a836)
Initializing gradle... -Oops; flutter has exited
unexpectedly.
/Crash report written to C:\Users\H&M\AndroidStudioProjects\code_01\flutter_04.log;
please let us know at https://github.com/flutter/flutter/issues.
/
是的,在用户和系统变量中,%path% 也为 flutter sdk 和 bin 文件夹正确设置了
最佳答案
[已解决]
问题出在 Windows 帐户名称(用户名)中的奇怪字符 (&)
解决步骤:
由于即使从控制面板更改用户名后,C:\Users\<"username">文件夹的名称也不会更改,因此创建了另一个用户。
将其设置为管理员。
已将 SDK 文件夹复制到另一个驱动器,以便 IDE 可以访问 他们没有管理员许可(即使以管理员身份打开 IDE 也没有给 其终端 smh 的管理员权限。
- 现在 VSCode 可以像 AS 一样完美运行。
关于flutter doctor - 系统找不到指定的路径[不重复],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59200693/