Reputation: 66
I am trying to build my first React Native App for Windows, I am following the instructions from the main site: https://microsoft.github.io/react-native-windows/docs/getting-started
which basically are:
1) npx react-native init fiveTest --template react-native
2) cd fiveTest/
3) npx react-native-windows-init --overwrite
4) npx react-native run-windows
Nonetheless, I am facing this issue after running the last command:
C:\gitrepo\daniel\fiveTest\node_modules\react-native-windows\Mso\dispatchQueue\dispatchQueue.h(728,17): error C2607: static assertion failed [C:\gitrepo\daniel\fiveTest\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(486,5): error MSB4181: The "CompileXaml" task returned false but did not log an error. [C:\gitrepo\daniel\fiveTest\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
Done Building Project "C:\gitrepo\daniel\fiveTest\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\gitrepo\daniel\fiveTest\windows\fivetest\fivetest.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\gitrepo\daniel\fiveTest\windows\fivetest.sln" (default targets) -- FAILED.
- Build failed with message Building Solution - error code 1. Check your build configuration.
× Build failed with message Building Solution - error code 1. Check your build configuration.
Any advice or suggestion to solve it?, have anyone build successfully a Windows App?
thanks in advance. Regards, Daniel.
Upvotes: 1
Views: 2042
Reputation: 36
This is an issue with the VS 2022 17.1 update. I fixed it by using Visual Studio 2019 instead.
Apparently VS 2022 is not officially supported for RN Windows yet: https://github.com/microsoft/react-native-windows/pull/9562
Upvotes: 1