Search code examples
androidflutterdartvisual-studio-codevscode-debugger

when I've tried to run my flutter in vs code it gave this error in debug console


Could not find an option with short name "-n".

Run 'flutter -h' (or 'flutter -h') for available flutter commands and options. Exited (64)


Solution

  • It sounds like some unexpected arguments are being passed to flutter when you try to run. These could come from a few different places:

    • Check if you have a .vscode/launch.json file, and whether you have anything unexpected in the args
    • Check the "Flutter Additional Args" and other similar settings in VS Code

    To find out exactly what command VS Code is trying to run:

    • Run the Dart: Capture Debugging Logs command from the command palette
    • Try to run the app to generate the error
    • Click Cancel on the logging notification to stop logging and open the log file
    • Search the log file for "Spawning" and it should show the full command VS Code is trying to run