Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. Flutter 2.0

23,722

Solution 1

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.

Solution 2

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.

Solution 3

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

Solution 4

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".

Solution 5

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 you 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

Share:
23,722
Kasun Hasanga
Author by

Kasun Hasanga

I`m Mobile app Developer from Sri lanka.

Updated on January 27, 2022

Comments

  • Kasun Hasanga
    Kasun Hasanga almost 2 years

    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