首页 > 解决方案 > 带有 VSCode 的 Flutter 显示未安装,即使已安装

问题描述

我只是颤抖着。我已经安装它并成功创建了一个项目。

但是当我尝试运行它失败了。

以下是颤振医生 -v 的输出

PS C:\android-app\flutter-app\flutter_first_app> flutter doctor -v
[√] Flutter (Channel master, v0.5.5-pre.9, on Microsoft Windows [Version 10.0.16299.461], locale en-US)
    • Flutter version 0.5.5-pre.9 at C:\android-app\flutter
    • Framework revision 587569337e (7 hours ago), 2018-06-13 00:02:21 +0200
    • Engine revision a328531402
    • Dart version 2.0.0-dev.60.0.flutter-a5e41681e5

[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
    • Android SDK at C:\Users\Sreyah Admin\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.0
    • ANDROID_HOME = C:\Users\Sreyah Admin\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    X Android license status unknown.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] VS Code, 64-bit edition (version 1.24.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected devices (1 available)
    • XT1706 • HKE63YLL • android-arm • Android 6.0 (API 23)

我已经安装了 Flutter 扩展。我尝试卸载并安装了几次,但仍然是相同的结果。

标签: visual-studio-codeflutter

解决方案


我认为这里有两个问题:

  1. 医生说你没有扩展
  2. 您的项目没有运行

1 医生说你没有扩展

这是我刚刚修复的一个错误。似乎 VS Code 最近可能已经开始小写扩展文件夹,我们对它们的测试是区分大小写的。该修复程序在 master 中,但尚未进入 beta 通道(截至 2018 年 6 月 22 日)。

注意:此检查不会影响其他任何内容,只要安装了扩展程序,这只是医生输出的问题。

2.你的项目没有运行

This is probably not related to the doctor output if you can see the extension in VS Code. You haven't included any info on the reason your app doesn't run (does it give an error? what do you see?) so it's hard to guess; but if you can provide that info I can take a stab.

If you haven't already, it's also worth running the project from the command line with flutter run to see if it works there, to see whether the issue is specific to VS Code or something else with your setup.

If if works from the command line then I would recommend opening an issue on GitHub for the Dart-Code repo with more information and we can track it down from there.


推荐阅读