我正在我的Linux Ubuntu 16.04 (Xenial Xerus)系统上配置Flutter SDK。为什么在运行颤振诊断程序时出现以下错误?

我已经在.bashrc文件中为flutter和dart指定了path,但是当我运行flutter doctor时,我得到了这个错误:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] IntelliJ IDEA Community Edition (version 2018.2)
[!] VS Code (version 1.25.1)
[!] Connected devices
    ! No devices available

! Doctor found issues in 2 categories.

当前回答

Mac安全修复(Android Studio 4.1+)。它现在在不同的目录中,但是符号链接有帮助。

在终端上运行这个命令:

ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1

如果您有不同的Android Studio版本或安装文件夹,请相应地调整该命令。

其他回答

我在更新Android Studio后遇到了类似的错误,原来我需要更新现有的Flutter插件。

要修复它,请到Android Studio→首选项→插件→已安装→更新已安装的Flutter插件。

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Linux, locale en_IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected devices
    ! No devices available

一个对我有效的解决方案:

只需要安装插件。 Android Studio→菜单文件→设置→插件→浏览存储库 搜索“颤振”。 点击安装(会弹出一个关于Dart依赖的对话框。单击Yes)。 安装完成后,重新启动Android Studio。

现在跑扑医生:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Linux, locale en_IN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[✓] Android Studio (version 3.1)
[!] Connected devices
    ! No devices available

androidflutterdartflutter-doctor

对于那些仍然有这个错误的人,即使他们已经尝试了前面提到的解决方案,试试这个。它适用于Windows 10, macOS和Linux(在命令行中运行):

颤振通道开发 颤振升级 flutter config——Android - Studio -dir="C:\Program Files\Android\Android Studio"

我也有同样的问题,但我在运行这些命令后修复了它:

flutter channel dev
flutter doctor
flutter channel master
flutter doctor

我遇到了同样的问题,上面的答案都没有解决它,所以我去了Flutter官方GitHub存储库,并在那里找到了答案。这是链接,你必须遵循所有这些步骤。

https://github.com/flutter/flutter/issues/67986

颤振升级

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

对于Mac,你可以按照Andrew回答的那样做:

ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1

flutter doctor -v

然后,如果问题仍然存在,那么只需转移到beta通道并升级Flutter。然后它会修复它。

颤振通道

颤振升级

可以作为可选步骤启用Flutter web。