【问题标题】:Unable to find suitable Visual Studio toolchain. Please run `flutter doctor` for more details找不到合适的 Visual Studio 工具链。请运行“颤振医生”以获取更多详细信息
【发布时间】:2020-06-05 15:25:15
【问题描述】:

我正在尝试在 Visual Studio 2019 中创建和运行 Flutter 桌面应用程序,我已经下载了所需的文件(MSBuild 和 MSVC),但仍然出现错误。我有 2013 版并卸载它并安装了 2019 版并且所有内容都已更新

当我运行 flutter run 命令时会发生这种情况

Launching lib\main.dart on Windows in debug mode...
Unable to find suitable Visual Studio toolchain. Please run `flutter doctor` for more details.

当我运行颤振时,医生给了我这个错误

[!] Visual Studio - develop for Windows (Visual Studio Community 2019 16.4.5)
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop
      development with C++" workload, and include these components:
        MSBuild
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        Windows 10 SDK (10.0.17763.0)

任何解决方案!

【问题讨论】:

    标签: visual-studio flutter-desktop


    【解决方案1】:
    1. 转到 Visual Studio 安装程序
    2. 点击修改
    3. 然后点击单个组件
    4. 并选择 Flutter Doctor 中显示的 Windows 10 SDK 的确切版本。

    就我而言,默认情况下,Visual Studio 安装程序安装了 Windows 10 SDK (10.0.18362.0),但 Flutter 需要 Windows 10 SDK (10.0.17763.0)。

    只需获取所示组件的确切版本即可。

    【讨论】:

      【解决方案2】:

      如果您收到该错误消息,则根据 Visual Studio,您至少缺少该列表中的一个必要组件。最可能的问题是您没有安装此处列出的 Windows 10 SDK 的确切版本,最新版本默认不包含该版本。

      编辑:上述确切的 SDK 版本要求在最初编写此答案时是准确的,但不适用于当前版本的 Flutter。)

      【讨论】:

      • 那是我下载 Windows 10 SDK (10.0.18362.0) 的问题.. 非常感谢
      • 我安装了所需的 windows 10 sdk 但问题是一样的
      【解决方案3】:

      您可能尚未安装 Visual Studio。

      从这里下载它https://visualstudio.microsoft.com/downloads/

      如果已安装,则再次运行安装程序并确保已安装使用 C++ 进行桌面开发工作负载,包括其所有默认组件。

      Visual Studio Installer Screen


      重新启动 IDE,然后运行应用程序。

      【讨论】:

        【解决方案4】:

        我在构建移动应用程序时也遇到了这个确切的错误。好像我没有选择要输出的设备。我选择了一个仿真器进行输出,现在代码正在运行。 只需单击 2 次,现在错误已解决。没有安装什么的。

        【讨论】:

        • 获得Unable to find suitable Visual Studio toolchain 错误消息的唯一方法是尝试为 Windows 构建。它与 Android 或 iOS 应用程序开发无关。
        猜你喜欢
        • 2021-01-28
        • 1970-01-01
        • 2020-08-20
        • 1970-01-01
        • 2020-03-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多