A brand new Flutter Project created in VSCode throws the above error when I try to run it on Windows. Detailed steps to reproduce below:
- I created a new default Flutter application in VSCode.
- I ran
flutter config --enable-windows-desktop
- I ran
flutter devices
.
Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1766] Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.66 Edge (web) • edge • web-javascript • Microsoft Edge 103.0.1264.44
I ran the app in Vscode without debugging and chose
Enable Windows for this Project
. It reported the error below.flutter create --platforms windows . The "--platforms" argument is not supported in module template. exit code 2
flutter doctor
output:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.4, on Microsoft Windows [Version 10.0.19043.1766], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.6)
[√] Android Studio (version 4.2)
[√] VS Code (version 1.68.1)
[√] Connected device (3 available)
[√] HTTP Host Availability
• No issues found!
Edit: I recreated the applitaion from the command line and it ran through without problems. Looks like whatever the problem is, it's coming from VSCode