1

I have installed the Chrome and set path of CHROME_EXECUTABLE as described in here so, flutter doctor gives me this result

[✓] Flutter (Channel stable, 2.0.6, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.6 at /home/bawantha/snap/flutter/common/flutter
    • Framework revision 1d9032c7e1 (2 weeks ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/bawantha/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/chromium

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at /var/lib/snapd/snap/intellij-idea-ultimate/295
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Chromium 90.0.4430.93 Arch Linux


However after I open my IDEA and run Tools-> Flutter-> Flutter Doctor it gives me there is no CHROME_EXECUTABLE set.

/home/bawantha/snap/flutter/common/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.0.6, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.6 at /home/bawantha/snap/flutter/common/flutter
    • Framework revision 1d9032c7e1 (2 weeks ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/bawantha/Android/Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9)
    • All Android licenses accepted.

[✗] 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 (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at /var/lib/snapd/snap/intellij-idea-ultimate/295
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[!] Connected device
    ! No devices available

Problem seems I need to set CHROME_EXECUTABLE in IDEA separately, but I don't know how to do so, your help would be very grateful.

Bawantha
  • 3,644
  • 4
  • 24
  • 36

3 Answers3

2

The problem is that IDE sees environment variables configured in ~/.profile (login shell), but not in interactive shell configuration files (like, ~/.bashrc).

Workaround 1: make required variables available in a login shell (i.e. for Bash, move them from .bashrc to .bash_profile or .profile), then restart X session (logout/login).

Workaround 2: run IDE from a terminal

Workaround 3: edit IDE desktop launcher and set command to /bin/bash -l -i -c "/path/to/webstorm.sh"

y.bedrov
  • 5,318
  • 3
  • 22
  • 19
1

It’s likely that .bashrc is not being read by the shell started by the IDE. Try other bash startup files (.bash_profile etc, Google them).

Or switch to zsh and use .zshenv . Zsh is more consistent.

Tip: Try playing a sound in those files to see if the IDE actually loads them.

HappyFace
  • 3,439
  • 2
  • 24
  • 43
  • Hi, Thank you for your reply, I actually don't know how to set those profile for IDEA can you guide me on that – Bawantha May 17 '21 at 03:05
  • @Bawantha Those are in your HOME directory (you can create them if they don't exist): `~/.bash_profile`, `~/.profile` – HappyFace May 17 '21 at 09:17
0

My problem was fix after a system update sudo pacman -Syu

Bawantha
  • 3,644
  • 4
  • 24
  • 36