Open Azkarell opened 7 months ago
Does it work if you run fvm
outside neovim: fvm flutter run
?
yes everything works as expected outside of neovim. only this plugin/neovim can't start it.
Please check the latest plugin version,https://github.com/akinsho/flutter-tools.nvim/commit/d8f2eac1734e0e68050bc57600e5f2ba775b1ec4 commit may help. If there is still a problem, please reopen the issue.
Facing this issue on windows with latest commits. This happens when I set fvm = true. However I've noticed that if i set fvm = false and add flutterpath = 'C:\Users\daban\fvm\versions\3.19.5\bin\flutter.bat' everthing works fine. Maybe change fvm path from ..\flutter to ..\flutter.bat. Any thoughts?
Yea, it looks like missing .bat
suffix is a problem. I will reopen this case to fix it.
I do not have Windows, so I am not sure if the path is the same as in macOS. @AyushUlric, if you have time please check if this works for you https://github.com/akinsho/flutter-tools.nvim/pull/386? The setup would be:
return {
"akinsho/flutter-tools.nvim",
branch = "fvm-on-windows",
...
}
@sidlatau, didn't work, same error. I hope I didn't mess up the setup as I am fairly new to nvim so attaching my setup code below.
I then updated all my plugins from the Lazy menu and restarted nvim.
I think on windows flutter and flutter.bat will always be in the same directory and the current path correctly points to the flutter file, hope that helps.
@AyushUlric thanks for testing. I see you are using a global path to fvm
flutter. But there should be a local one in your project, in .fvm
directory:
Plugin constructs path .fvm/flutter_sdk/bin/flutter.bat
. Does this file exist in your project? Did you run fvm use <flutter version>
in your project directory?
@sidlatau Yes I did run the fvm use command and I have the .fvm directory in my project root. But I noticed that flutter_sdk directory is actually a shotcut which points to the global fvm path. I checked all my fvm projects and it seems to be common in all of them.
Maybe that's how it is on Windows?
BTW I added the global path because thats what showed up in error logs with path not found.
Is there an existing issue for this?
Current Behavior
Running :FlutterRun with fvm enabled throws ENOENT: no such file or directory in windows although path is detected correctly
Expected Behavior
Running :FlutterRun in windows should run flutter
Steps To Reproduce
my conifg with lazy: { 'akinsho/flutter-tools.nvim', lazy = false, dependencies = { 'nvim-lua/plenary.nvim' }, config = function() require('flutter-tools').setup { fvm = true, -- debugger = { -- enabled = true, -- run_via_dap = true, -- register_configurations = function(paths) -- local file = io.open('.vscode/launch.json', 'r') -- if file ~= nil then -- io.close(file) -- require('dap.ext.vscode').load_launchjs() -- end -- end, -- }, } require('telescope').load_extension 'flutter' end, },
Environment
Anything else?
I tried to find out what is happening and it might not even be the fault of this tool but i am quite new to neovim and just evaluating if i want to continue using it. what i found that just the line :lua =vim.uv.spawn("C:\\\fvm\versions\3.13.9\bin\flutter", { { "run" }}) already fails
just running "C:\\\fvm\versions\3.13.9\bin\flutter" in pwsh or cmd or even with Start-Process is working.