Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 847
Kasun Hasanga Avatar asked Mar 15 '21 03:03

Kasun Hasanga


People also ask

How do I add flutters to Chrome?

Download and install Android Studio. Start Android Studio, and go through the 'Android Studio Setup Wizard'. This installs the latest Android SDK, Android SDK Command-line Tools, and Android SDK Build-Tools, which are required by Flutter when developing for Android. Accept Android licenses.

Where is the Chrome exe file?

The chrome.exe file is located in a subfolder of "C:\Program Files (x86)" (e.g. C:\Program Files (x86)\Google\Chrome\Application\).

Where is chrome path on Ubuntu?

On a Mac, select Go in the Finder menu, then click Go to Folder. Paste the path into the textbox and click Go. On Ubuntu, select Go in the Files app menu, then click Enter Location. Paste the path into the textbox and hit Enter.


3 Answers

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.

like image 93
John Michie Avatar answered Oct 16 '22 15:10

John Michie


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

like image 44
CoderBlue Avatar answered Oct 16 '22 14:10

CoderBlue


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

like image 23
Anh-Thi DINH Avatar answered Oct 16 '22 13:10

Anh-Thi DINH