LoginSignup
6
1

More than 3 years have passed since last update.

Chrome OS にFlutterをインストールしたときにChromeが見つからないというエラーが出たときの対処方法

Posted at

FlutterをChrome OSにインストールする場合、
Chrome OS install
のドキュメントを参考に進めていくのですが
最後まで進めても

flutter doctor

を実行したときに手順通りだと

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.26.0-2.0.pre.275, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio
[✓] Connected device (1 available)

とどうしてもバツのまま残ってしまう項目があります。
調べたところGithub上のissueで追加の手順が必要なことが指摘されています。
[web]: Document how to do flutter development on chromeos #72982

On a chromebook to run flutter for web development I found it best to install Chromium browser from Crostini (Linux Beta);
$ sudo apt install chromium
Then in bashrc make sure to add this;
export CHROME_EXECUTABLE=/usr/bin/chromium

Everything works fine thereafter including development with Android Studio

コメントにある通り
Crostini上でChromiumをインストール

sudo apt install chromium

した後に

CHROME_EXECUTABLE=/usr/bin/chromium
~/.bashrcに設定すれば結果が正常になります。

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.26.0-2.0.pre.275, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] Connected device (2 available)

• No issues found!

公式ドキュメントへの追加が提案されていますのですぐに正しい手順になると思うのですが
困っている方がいたら参考にしてください。

6
1
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
6
1