0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Linuxでflutter doctorをするとAndroid Studioでエラーが出る

Posted at

はじめに

Flutterの初期設定をする際にAndroid Studioの設定で躓いたのでまとめます

問題

flutter doctorをすると現在以下のステータスになります

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for
      more details.

解決方法

まずはcommandline-toolsをダウンロードします

image.png

Command line tools onlyからLinuxをダウンロードします

ダウンロードしたら解凍しておきます

解凍した cmdline-tools ディレクトリに latest というサブディレクトリを作成します

cmd-toolsディレクトリ/home/ユーザー名/Android/Sdk/に移動します

以下のコマンドを実行します

$ export ANDROID_SDK_ROOT=/home/watanabejin/Android/Sdk/
$ flutter doctor --android-licenses

するとうまくいきました

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on Ubuntu 20.04.6 LTS 5.15.0-76-generic,
    locale ja_JP.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Community Edition (version 2023.1)
[✓] VS Code (version 1.77.3)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

おわりに

やっと環境構築が終えたので勉強を進めていきたいです

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?