flutter 需要安装 Android Studio 还是 android studio 可以替代?

Is it necessary to install Android Studio for flutter or what can be replacement for android studio?

我正在使用 vscode 并安装了 flutter 插件、Dart 插件等,但仍然找不到我的设备,我发现问题如下

[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows 
[Version 10.0.18362.239], locale en-IN)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: 
https://developer.android.com/studio/index.html
  On first launch it will assist you in installing the Android SDK components.
  (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
  If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
  You may also want to add it to your PATH environment variable.

[!] Android Studio (not installed)
[√] VS Code (version 1.36.1)
[!] Connected device
! No devices available

! Doctor found issues in 3 categories.

您将需要 Android SDK 才能开发 Android 应用程序。如果您不想安装 Android Studio,则必须使用命令行工具。 https://developer.android.com/studio#downloads

如果您熟悉使用命令行,那么您可以这样做。 https://developer.android.com/studio/command-line

您需要安装 Android Studio 才能获得 Android SDK。使用Android Studio获取Android SDK后,可以继续使用VScode进行flutter开发

希望这个回答对您有所帮助!

第一个问题,可以在flutter doctor日志中看到x标记:

[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: 
https://developer.android.com/studio/index.html
  On first launch it will assist you in installing the Android SDK components.
  (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
  If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
  You may also want to add it to your PATH environment variable.

说明您没有Android SDK或者您还没有设置Android SDK的路径。

第二期

! No devices available

说明你没有安装设备驱动或者你的OS无法识别设备

上次,

Is it necessary to install Android Studio for flutter or what can be replacement for android studio?

没有必要安装 Android Studio。但我认为您需要使用 IntelliJ 或 Android studio 而不是 VS Code。这是因为 InteliJ 或 Android Studio 作为 Full-fledged IDE 比仅作为编辑器的 VS Code 具有更多的功能。

你不需要特别需要Android Studio,你只需要Android SDK,下载它并将环境变量设置为SDK路径,以便flutter安装识别它。

可以参考这篇中篇文章:https://medium.com/@sadabwasim/flutter-in-linux-37d32890745b