17

I installed Flutter beta version using official guide. Enabled web:

 flutter channel beta
 flutter upgrade
 flutter config --enable-web

The result is:

Setting "enable-web" value to "true".

You may need to restart any open editors for them to read new settings.

The result of flutter devices command:

>flutter devices
1 connected device:

Web Server • web-server • web-javascript • Flutter Tools

The official guide points that there should be two devices:

Chrome     • chrome     • web-javascript • Google Chrome 78.0.3904.108
Web Server • web-server • web-javascript • Flutter Tools

I created sample app from the official guide and tried to build it:

 flutter create myapp
 cd myapp
 flutter run -d chrome

The result is:

No devices found with name or id matching 'chrome'

Latest Google Chrome is installed. I have read on github the problem could be solved by setting environment variable CHROME_EXECUTABLE. I tried to set it using path to chrome.exe and path to folder containing chrome.exe with same unsuccessful result.

I executed flutter doctor -v:

[X] Chrome - develop for the web (Cannot find chrome executable at "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
    ! "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" is not executable.

I thought the problem could be in path with spaces but setting different path in CHROME_EXECUTABLE does not solve the problem.

[X] Chrome - develop for the web (Cannot find chrome executable at "D:\Portable\Chromium\chrome-win\chrome.exe")
    ! "D:\Portable\Chromium\chrome-win\chrome.exe" is not executable.

Does anybody have any idea?

Michael Lukin
  • 829
  • 3
  • 9
  • 19
  • I assume you are running on windows 10. Can you try to run `refreshenv` in the command prompt where you are running this app and test. I assume you have only one flutter installation in your path. Also try running the IDE or the command prompt as an administrator. – Abhilash Chandran Mar 21 '20 at 10:54
  • @AbhilashChandran I tried `refreshenv` in command prompt and tried run shell as administrator, but result is the same: `! "D:\Portable\Chromium\chrome-win\chrome.exe" is not executable.` When I execute `D:\Portable\Chromium\chrome-win\chrome.exe` it executes chrome. – Michael Lukin Mar 21 '20 at 16:14
  • 1
    can you try setting the path up until `D:\Portable\Chromium\chrome-win` without the `chrome.exe`. Not sure if this will help. Also make sure you don't have the `" "` around this path string. – Abhilash Chandran Mar 21 '20 at 16:33
  • I am sure you must have restarted the IDE but just to be sure.. :D Sometimes in android studio you need to invalidate caches and restart. Please do post the full report of `flutter doctor` then flutter maintainers can quickly point out if its a known issue.. – Abhilash Chandran Mar 21 '20 at 16:51
  • 1
    @AbhilashChandran The problem was in `" "` around the path string, thank you! Now it works. I propose you to write this comment as an answer for marking as question is solved. – Michael Lukin Mar 26 '20 at 20:00
  • @AbhilashChandran - "Also make sure you don't have the " " around this path string." this is the trick! thank you!! – Pratyush Jul 10 '21 at 22:15

5 Answers5

11

Did you try to switch to master channel ? Or to run "flutter create ." in the project root ?

If not, you can try :

flutter channel master
flutter upgrade
flutter config --enable-web
cd <into project directory>
flutter create .
flutter run -d chrome
MickaelHrndz
  • 3,604
  • 1
  • 13
  • 23
  • 4
    The result is No devices found with name or id matching 'chrome' – Michael Lukin Mar 21 '20 at 04:56
  • Work like a charm. Thank you. – Utku Aug 04 '20 at 21:41
  • This works for me. I previously at `stable` channel, and no chrome listed as device. Why switching to `master` channel solved this? – swdev Jan 13 '21 at 22:50
  • This is because the Windows support was in pre-alpha (master) and is in alpha currently (dev). [More info on channels](https://github.com/flutter/flutter/wiki/Flutter-build-release-channels) if you're interested. – MickaelHrndz Jan 13 '21 at 23:10
6

This solution worked for me:

$ flutter upgrade
$ flutter config --enable-web
$ flutter run -d chrome

If chrome is not available in Flutter device selection try restarting the IDE.

Corentin Houdayer
  • 988
  • 2
  • 8
  • 19
Android_id
  • 1,521
  • 1
  • 15
  • 33
3

As OP suggested I am listing my comments from above, as an answer. I believe the portable chrome usage is new w.r.t flutter and suspect this could be useful for others instead of deleting the question.

Some of the options you can try in Windows 10 are.

  1. Run the refreshenv command in the commanda prompt.
  2. Make sure to have correct flutter installation in your path.
  3. Remove the double quotes " " around the path string.

In this case the 3rd option solved the issue.

Abhilash Chandran
  • 6,803
  • 3
  • 32
  • 50
2

Create system environment variables for user and system with Variable name: chrome Variable path: path_to_chrome

1

turns out thiscan be fixed by switching channels

i.e.

flutter channel
flutter channel beta
Getshauky
  • 11
  • 3