【问题标题】:Flutter Web App Error: CHROME_EXECUTABLE= "..." is not executableFlutter Web App 错误:CHROME_EXECUTABLE="..." 不可执行
【发布时间】:2021-01-23 08:00:47
【问题描述】:
我想为我的 Flutter Web 应用程序禁用 Web 安全。
我试过了:
- 在
$HOME/.zshrc 中设置export CHROME_EXECUTABLE=/path/to/google-chrome-unsafe.sh
- 使用内容
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --user-data-dir="tmp-dir" $* 创建google-chrome-unsafe.sh
- 使用
chmod a+x google-chrome-unsafe.sh 使其可执行
起初它是这样工作的。但是,现在总是有错误消息。有谁知道如何解决这个问题?
Android Studio: error message
【问题讨论】:
标签:
android-studio
google-chrome
flutter
flutter-web
【解决方案1】:
即使您的系统中有一个 google chrome 应用程序。它可能有类似google-chrome-stable 或chrome 之类的命令或任何从终端打开chrome 浏览器的名称。只需在/usr/bin/ 中复制带有google-chrome 名称的文件
例如:我有 google-chrome-stable 作为可执行文件,所以我的方法就像
cp /usr/bin/google-chrome-stable /usr/bin/google-chrome
根据您的安装方式,您可能在 snap 文件夹或其他文件夹中有 bin
如果您没有从终端执行 chrome,请创建一个符号链接。找到你的 chrome 二进制文件并使用这个命令
ln -s $PATH/[google-chrome-bin] /usr/bin/google-chrome
用你的二进制文件名替换[google-chrome-bin]