After flutter opens the web development mode, when executing flutter doctor
, it will report the error of Try setting CHROME_EXECUTABLE to a Chrome executable . After testing, the cause has been found and the error has been resolved. The solution steps are as follows
Note: All operation steps are completed under Ubuntu20
1. Ensure that Chrome has been installed on the machine or a browser using the Chrome kernel
Execute the command in Terminal:
whereis chromium
Find the installation path of chromium (my chromium installation path is /snap/bin/chromium ).
2. Configure environment variables
If you want the environment variable to take effect only for the currently logged in user, execute the following command:
sudo gedit ~/.bash_profile
After opening the .bash_profile file, start a new line at the bottom and enter the following statement:
export CHROME_EXECUTABLE=/snap/bin/chromium
Save and close the .bash_profile file, and execute the following command in Terminal:
source ~/.bash_profile
3. Execute againflutter doctor
We will see that the previous error is gone