Dart-Code: Chrome not showing up in Flutter: Select Device

i’m on Manjaro. i’ve install google-chrome from AUR and it shows up in flutter doctor , flutter devices when executed from terminal. the problem is when i run flutter doctor from vscode it says

[✗] Chrome - develop for the web (Cannot find chrome executable at google-chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 19 (9 by maintainers)

Most upvoted comments

Have you set CHROME_EXECUTABLE in a terminal startup script that might not apply to VS Code?

Does it work if you launch VS Code from the terminal (where it works)?

You could also try setting the dart.env VS Code User Setting to apply env variables to all Dart/Flutter processes.

{
  "dart.env": {
    "CHROME_EXECUTABLE": "/foo"
  }
}

Also, if you capture the Daemon Log, that should show whether the device is not showing up at all, or being filtered out because it thinks your project is not a web project.

I was setting $CHROME_EXECUTABLE in my .zshrc, but that didn’t carry over into vscode

Yeah, that’s a common problem. If VS Code is launched in a way that doesn’t inherit these environment variables, then of course it can’t find them. It’s better if you can set the variables somewhere globally so that all programs inherit them no matter how they’re launched, but that may be harder (if even possible) depending on your OS.

However, now the Flutter daemon exited on launch with (essentially) this log

Can you run flutter doctor -v from a terminal, and then also using the Flutter: Run Flutter Doctor command in VS Code and attach the outputs of each in a new issue? Also include whether /home/smolck/Android/Sdk/platform-tools/adb is the correct location of adb for you.

If so, does your project have a web folder? VS Code only shows devices that can run your open project, whereas flutter devices is showing all devices.

Yup; flutter run -d chrome works fine in a terminal, and actually now web-server (web-javascript) shows up as a device, but still no chrome. And if I try to click the device in the lower right hand corner, the Flutter daemon stops and asks if I want to restart it.

I think these issues are due to using NixOS (my specific NixOS setup), so I’ll open an issue as you said for debugging. Probably will open it later today assuming I have time.