react-native-checkbox / react-native-checkbox

Checkbox component for React Native
MIT License
377 stars 88 forks source link

React-Native-Checkbox cannot be built with Windows2022 Github Runner #220

Open mcampbellxperi opened 4 months ago

mcampbellxperi commented 4 months ago

Hello,

I've recently updated a React Native Windows project to run on Visual Studio 2022, since RNW > 0.71 requires VS2022 to build.

I've installed the latest version of react-native-checkbox: 0.5.17, and found that I am unable to build this on the windows2022 Github actions runner.

See build error from action below:

✖ Build failed with message C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.18362.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [D:\a\project\project\node_modules\@react-native-community\checkbox\windows\CheckboxWindows\CheckboxWindows.vcxproj]. Check your build configuration.

Looking at the Windows2022 runner config, the minimum Windows SDK that is supported on the image is 19041.

image

Could the project be updated to target Windows SDK >=19041?

Thanks.

mcampbellxperi commented 4 months ago

Adding this step to my build job got me past this issue, however it's a band-aid fix that shouldn't be treated as resolved.

      - name: Customize dependencies
        env:
          Checkbox_Proj_Path: node_modules\@react-native-community\checkbox\windows\CheckboxWindows\CheckboxWindows.vcxproj
        run: (Get-Content .\$env:Checkbox_Proj_Path) -replace "10.0.18362.0", "10.0.19041.0" | Out-File -encoding utf8 .\$env:Checkbox_Proj_Path