Flutter Web App Error: CHROME_EXECUTABLE= "..." is not executable

Viewed 2747

I wanted to disable web security for my flutter web application. I tried:

  1. Set export CHROME_EXECUTABLE=/path/to/google-chrome-unsafe.sh in $HOME/.zshrc
  2. Create google-chrome-unsafe.sh with the content /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --user-data-dir="tmp-dir" $*
  3. Make it executable with chmod a+x google-chrome-unsafe.sh

At first this is how it worked. However, now there is always an error message. Does anyone have any idea how to solve the problem?

Android Studio: error message

1 Answers

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

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

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

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

Related