45

I updated My flutter Version from 1.22 to 2.0. There are some errors in Flutter Doctor. How Could I solve this. That happen Afer Updated my Flutter Version.

I am Using Android Studion 4.1.2, Ubuntu 20.04.2 LTS(64 bit)

enter image description here

Kasun Hasanga
  • 1,626
  • 4
  • 15
  • 35

17 Answers17

48

For Ubuntu 20.04, chromium is managed by snap. I set the environment variable as shown below.

CHROME_EXECUTABLE=/snap/bin/chromium
export CHROME_EXECUTABLE

Try 'type chromium' to make sure of the location on your system. I assume something similar will work for chrome.

M at
  • 1,020
  • 1
  • 12
  • 26
John Michie
  • 481
  • 1
  • 4
  • 2
  • 2
    I'm using Linux Mint 20.02 so I use chromium but I've same problem and I'm unable to fix it. `type chromium` output is: `chromium is /usr/bin/chromium` `echo $CHROME_EXECUTABLE` output is: `/usr/bin/chromium` Do you know how can I fix it? BTW, I'v the same issue with snap version (I uninstalled it) – mbnoimi Sep 07 '21 at 14:57
  • this solution proposed here, indeed solved it for me !!! – Daniel Henry Thomas Oct 31 '21 at 18:00
  • also if you installed via apt, ou can set the path as: /user/bin/chromium-browser – Williams Bobadilla Jun 17 '22 at 19:30
  • `echo $CHROME_EXECUTABLE` nothing shows up, the output is empty – coco bar Feb 10 '23 at 05:05
  • 1
    This works but everytime I close and reopen vscode this comes again!! what should I do – Benyamin Jul 20 '23 at 15:02
38

For ones who use MacOS and with another chromium-based browser than Google Chrome (Brave in my case). You can set in .zshrc or .bashrc

export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"

After that, don't forget to source ~/.zshrc or source ~/.bashrc in the current terminal window.

flutter doctor -v

Now, "Chrome" will be seen as "Brave".

Anh-Thi DINH
  • 1,845
  • 1
  • 23
  • 17
  • 2
    For Brave on windows, see CoderBlues Post below, but add C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe Obviously also check if that is indeed your path :) – DORRITO Jan 20 '23 at 17:14
25

I had the same error in Windows 10, Using VS Code even after setting CHROME_EXECUTABLE system environmental variable to the path of chrome.exe. I solved it by removing the double quotes around the path:

enter image description here

CoderBlue
  • 695
  • 7
  • 14
15

I'm on a Chromebook. I installed Flutter and Android Studio. When I ran $flutter doctor -v, I got the same error message that you got.

I didn't need to export the file path to my path environment. I just needed to install Chrome so that Flutter could find it on my Chromebook.

Here was the command that worked for me:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Then I installed it using the Linux beta command (right click on the downloaded file, install using Linux beta). It installed it to this directory:

/usr/bin/

(Alternatively, for the install, I could've used this command:

sudo apt install ./google-chrome-stable_current_amd64.deb)

I ran flutter doctor -v and now it finds Chrome.

Chef Tech
  • 321
  • 2
  • 9
15

Even though you have a google chrome app in your system. It may have command like google-chrome-stable or chrome or any name to open chrome browser from terminal. Just duplicate the file with google-chrome name in /usr/bin/

Eg: I have google-chrome-stable as executable so my approach is like

sudo cp /usr/bin/google-chrome-stable /usr/bin/google-chrome

You may have bin in snap folder or some other folder depending on your installation way

If you're not having chrome as executable from terminal then create a symbolic link. Find your chrome binary file and use this command

sudo ln -s $PATH/[google-chrome-bin] /usr/bin/google-chrome

Replace [google-chrome-bin] with your binary file name

7

you can export PATH in your .bashrc or .zshrc if you use Linux or MAC OS you can found installed chrome PATH using which

for example

which google-chrome
# example result : /opt/google/chrome/google-chrome

then add to .zshrc or .bashrc like this

# Chrome PATH
export PATH=$PATH:/opt/google/chrome

then restart source

source .zshrc # change if you use .bashrc

running the flutter doctor

you will see the output like this

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.1, 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 (version 4.2)
perymerdeka
  • 766
  • 9
  • 19
6

The answers here have helped me setup Flutter on Mac with Microsoft Edge instead of Chrome. For that, you simply run from your terminal:

export CHROME_EXECUTABLE="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"

If you want to make this permanent, you should add the above line to the file

~/.zshenv or ~/.zshrc

Then save and restart terminal.

Des
  • 93
  • 1
  • 6
4

For Linux users, you can add Edge Browser like this...

first, add this path in .bashrc file path

PATH=$PATH:/usr/bin/microsoft-edge-stable

then execute this command

export CHROME_EXECUTABLE="/usr/bin/microsoft-edge-stable"

1

For MacOS Users

  1. cd to /Users/<your user>
  2. sudo nano ~/.zshenv
  3. Add the following:
export PATH="$PATH:/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
export CHROME_EXECUTABLE="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
  1. Save the file and restart the IDE terminal
  2. Run flutter doctor enter image description here
Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61
1

For MacOs User (Vivaldi Browser or Brave Browser)

This command sets your PATH variable for the current terminal window only. To permanently add CHROME_EXECUTABLE to your path

For Vivaldi Browser USer

export CHROME_EXECUTABLE="/Applications/Vivaldi.app/Contents/MacOS/Vivaldi"

For Chrome User

export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"

To Find Path of browser

Go to Activity monitor and Double click the browser you want a pop up will come choose open Files and port to see the location as seen below

Location of browser to be added

To permanently add CHROME_EXECUTABLE to your path

  1. Open (or create) the rc file for your shell. Typing echo $SHELL in your Terminal tells you which shell you’re using. If you’re using Bash, edit $HOME/.bash_profile or $HOME/.bashrc. If you’re using Z shell, edit $HOME/.zshrc. If you’re using a different shell, the file path and filename will be different on your machine.
  2. If you are using zsh create .zshrc enter a command touch .zshrc which will create a .zshrc file at your hardisk and vice versa for bash.
  3. Go to your finder and press shift + command + H after that again hit a command shift + command + . you will find .zshrc file.
  4. now open .zrch file and add your path of your browser as i am using brave browser browser I will Use,

export CHROME_EXECUTABLE="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" enter image description here

  1. Check the summary. enter image description here
1

For Microsoft Edge users on Ubuntu or spinoffs. You just need to give environment variable the 'path' of edge executable, for that we will see user

 export CHROME_EXECUTABLE="/usr/bin/microsoft-edge-beta"

Right now edge on Linux is in beta, you can check /usr/bin to locate correct executable in future. Then don't forget to reload environment variable by

source ~/.bashrc

Or whatever environment you use like zshrc etc.

Run command flutter doctor, you must see Chrome path now.

upendra
  • 21
  • 1
  • 4
0

in my case it was because the name of my chrome was "google chrome 2.app" i renamed it to "google chrome.app"

sergannn
  • 11
  • 2
0

You can also try with just chrome instead of google-chrome.

Ravi
  • 59
  • 2
0

I am using Garuda Linux and this worked for me

sudo cp /usr/bin/google-chrome-stable /usr/bin/google-chrome

0

In my case Google chrome was not installed in my MacBook Pro M1 chip. Installing google chrome and allowing all recommended permissions resolve my issue.

Zain
  • 1
0

Solution for me on Manjaro with ZSH

which google-chrome-stable

For me: /usr/bin/google-chrome-stable

vim ~/.zshrc

Add the following:

export CHROME_EXECUTABLE="/usr/bin/google-chrome-stable"

Then save file and do:

source ~/.zshrc
emccracken
  • 839
  • 12
  • 21
0

I have simple ran: sudo snap install chromium

After that, I ran command "flutter doctor" back again and chrome error was gone

:~$ flutter doctor
  Doctor summary (to see all details, run flutter doctor -v):
 [✓] Flutter (Channel stable, 3.10.6, on Ubuntu 22.04.2 LTS 5.19.0-46-                                                generic, locale en_US.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)
 [✓] VS Code
 [✓] Connected device (2 available)
 [✓] Network resources
Jorgehel
  • 1
  • 5