我正在尝试构建我的第一个,我正在按照主站点的说明:https://microsoft.github.io/react-native-windows/docs/getting-started
基本上是:
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尽管如此,在运行最后一个命令之后,我仍然面临着这个问题:
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.有任何建议或建议来解决这个问题吗?是否有人成功地构建了一个Windows应用程序?
提前谢谢。你好,丹尼尔。
发布于 2022-02-21 07:57:37
这是VS 2022 17.1更新的一个问题。我通过使用Visual 2019来修复它。
显然VS 2022还没有被RN正式支持:https://github.com/microsoft/react-native-windows/pull/9562
https://stackoverflow.com/questions/71180871
复制相似问题