如何在 ubuntu 20.04 上安装 Flutter?

如何在 ubuntu 20.04 上安装 Flutter?

事实上我几乎完成了安装,唯一的问题是当我运行时flutter doctor我收到此错误报告:

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.5, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 27.0.1)
    ✗ Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
      To update using sdkmanager, run:
        "/usr/lib/android-sdk/tools/bin/sdkmanager" "platforms;android-28"
        "build-tools;28.0.3"
      or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions.
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit visit
      https://flutter.dev/docs/get-started/install/linux#android-setup for
      detailed instructions.
[✓] Android Studio (version 4.0)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

正如我所说,我正在使用 Ubuntu 20.04,并且安装了 Andrroid studion: SDK 设置

答案1

它说你正在使用 Android SDK 版本 27.0.1。但 Flutter 需要 Android BuildTools 28.0.3。更新 Android Studio 版本的完整说明如下:https://developer.android.com/studio/intro/update

更新 Android Studio 版本后,运行

$ Flutter 医生

然后 flutter doctor 会告诉你运行一个 android studio 许可协议的命令。只需运行该命令并输入 y 继续,然后你就完成了!{以我的亲身经历来说}

谢谢。

相关内容