Skip to content

[Windows] Newly created windows project fails to build in Visual Studio 2022  #103728

Closed

Description

@sebastianhaberey

Steps to Reproduce

  1. flutter create --platforms=windows foo
  2. cd foo
  3. flutter build windows
  4. MS Visual Studio 2022 > Open a local folder > foo/windows > (wait for CMake generation to finish)
  5. Menu > Build > Build All

Expected results:

Build succeeds

Actual results:

Build fails with Command line error D8021: invalid numeric argument '/wd"4100"'

Comment

I figured out this can be fixed by removing the quotation marks around the 4100 in the CMakeLists.txt:

target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")

Are these intentional? If not, maybe they could be removed to make things easier for VS 2022 users.

Logs
λ flutter doctor -v
[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.19044.1645], locale de-DE)
    • Flutter version 3.0.0 at C:\Tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (4 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\User\AppData\Local\Android\sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.0)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32505.173
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.67.1)
    • VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1645]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 101.0.4951.64
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 101.0.1210.39

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Activity

  1. stuartmorgan-g commented on May 13, 2022

    @stuartmorgan-g
    Contributor

    4. MS Visual Studio 2022 > Open a local folder > foo/windows > (wait for CMake generation to finish)

    This is not currently supported. To open in VS, you need to open the generated sln in build/windows/.

    Closing as a duplicate of #99584

  2. github-actions commented on May 27, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  3. locked as resolved and limited conversation to collaborators on May 27, 2022
  4. added a commit that references this issue on Aug 31, 2026
    74e9059
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions