Rahul Raj
Rahul Raj

Reputation: 342

Flutter Web Device Not Showing in Android Studio & VS Code

I am trying to develop a web app with flutter but my device is not showing there in IDE when i execute flutter devices

$ flutter devices
2 connected devices:

Chrome     • chrome     • web-javascript • Brave Browser 78.1.0.1 unknown
Web Server • web-server • web-javascript • Flutter Tools

I could see two devices there but when i am using Andoid studio or vs code the browser is not showing up there Thease are the screen shots from andoid studio and vs code ScreenShot From VS Code ScreenShot From Android Studio

Upvotes: 4

Views: 3166

Answers (2)

phaylali
phaylali

Reputation: 53

The answer above does work, but sometimes it doesn't. Especially for Linux distros have different ways of defining variables. However, what I found to be always working especially in manjaro are following:

  • opening the file manager with root
  • going to /etc/profile.d
  • create a file, you can name it whatever you want, in this case we can name it chrome.sh (.sh is necessary)
  • open the file and type the variable you want, with the export command (for example, i wanted to specify microsoft edge dev as the default chrome)

export CHROME_EXECUTABLE=/usr/bin/microsoft-edge-dev

  • restart your pc, and you're done

Upvotes: 1

Rahul Raj
Rahul Raj

Reputation: 342

The Issue is solved by setting the path variable globally in my Linux by editing the file /etc/environment by running

sudo nano /etc/environment

and then adding the line

CHROME_EXECUTABLE=/opt/google/chrome/chrome

setting the CHROME_EXECUTABLE=<path-to-chrome-chromium-or-brave> and restarting fixed my problem

Upvotes: 6

Related Questions