flutter-tools.nvim icon indicating copy to clipboard operation
flutter-tools.nvim copied to clipboard

[Bug]: Windows related issue starting flutter

Open Tsuzat opened this issue 1 year ago • 4 comments

Describe the bug The same configuration is not working in windows that worked in Linux. I'm attaching a video for reference. Video

To Reproduce Steps to reproduce the behavior:

  1. Go to any flutter project using Powershell or Git Bash, Open it in NeoVim
  2. do run the command "FlutterRun" or "FlutterDevices"
  3. See error

Error is somewhat like this

Error executing Lua callback: ...\site\pack\packer\start\plenary.nvim/lua/plenary/job.lua:405: Failed to spawn process:

stack traceback:
        ...\site\pack\packer\start\plenary.nvim/lua/plenary/job.lua:405: in function '_execute'
        ...\site\pack\packer\start\plenary.nvim/lua/plenary/job.lua:448: in function 'start'
        ...r\start\flutter-tools.nvim/lua/flutter-tools/devices.lua:198: in function 'callback'
        ...tart\flutter-tools.nvim/lua/flutter-tools/executable.lua:157: in function 'get'
        ...tart\flutter-tools.nvim/lua/flutter-tools/executable.lua:156: in function 'flutter'
        ...r\start\flutter-tools.nvim/lua/flutter-tools/devices.lua:190: in function 'list_devices'
        ...ck\packer\start\flutter-tools.nvim/lua/flutter-tools.lua:31: in function <...ck\packer\start\flutter-tools.nvim/lua/flutter-tools.lua:30>

Expected behavior The expected behavior (that it does in Linux) is to run flutter or show a list of devices.

Screenshots image image

System information

  • OS: Windows 11
  • Flutter version: 3.3.3 Channel Stable
  • Is flutter in $PATH: Yes it is in C:\Development\flutter\bin\flutter.bat
  • neovim version: 0.8.0

Additional context I'm using the default configuration in both my machine Linux and Windows. It works smoothly in Linux but not in Windows.

Tsuzat avatar Oct 01 '22 18:10 Tsuzat

@Tsuzat I don't use Windows, so there's no chance I'll be able to fix this for you, as I don't know anything about changing the paths or whatever else is required. If you are able to point in the direction of what might not be working, that might be useful. Otherwise, as a Windows user you will have to do some more debugging

akinsho avatar Oct 01 '22 18:10 akinsho

@Tsuzat it's important to clarify that you might need to change your config to work with windows and vice versa I've never guaranteed that this would work automatically as I do not use or test on Windows, so I definitely cannot guarantee that. Other Windows users are able to use this plugin successfully, so I doubt this is an issue with the plugin and more likely you need to tweak your configuration using some conditional logic when running on Windows.

akinsho avatar Oct 01 '22 22:10 akinsho

I appreciate the hard work you putting in. I don't want to put an extra burden on you. I'll try to debug it by myself. But can you give me an idea of what could have gone wrong with the configuration?

Tsuzat avatar Oct 02 '22 04:10 Tsuzat

@Tsuzat I'm not really sure what is going wrong but it seems like it's trying to run the command to list the users devices and it cannot find flutter. You seem to have indicated that your flutter path is \\C:Development etc. I would try and run that command i.e. the full path that is in your error message plus the command devices and see if that actually works in your system

akinsho avatar Oct 03 '22 07:10 akinsho

I guess I'll use this tool in Linux then. Thanks for the help.

Tsuzat avatar Oct 27 '22 07:10 Tsuzat