Closed Ryan-Pell closed 3 years ago
@Ryan-Pell can you provide some more info?
npx react-native info
npx react-native run-windows
This issue lacks the environment info requested in the bug template. Please edit your issue report to add this information.
If you are using latest version:
npx react-native --version
:npx react-native run-windows --info
:Otherwise if --info
doesn't exist:
react-native -v
:npm ls rnpm-plugin-windows
:npm ls react-native-windows
:node -v
:npm -v
:yarn --version
:npx react native info:
System:
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
Memory: 6.60 GB / 15.96 GB
Binaries:
Node: 14.15.5 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 7.5.4 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Enabled
AllowDevelopmentWithoutDevLicense: Enabled
Versions: 10.0.16299.0, 10.0.17763.0, 10.0.18362.0
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.6858069
Visual Studio: 16.8.31005.135 (Visual Studio Community 2019)
Languages:
Java: 1.8.0_282
Python: 3.9.1
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
react-native-windows: ^0.63.0-0 => 0.63.22
npmGlobalPackages:
*react-native*: Not Found
npx react-native run-windows --logging:
Thanks for the info @Ryan-Pell . I was hoping the detailed log had more info but it looks like we are failing to find a header file that is supposed to be generated by cppwinrt based on our WinMD.
Is this happening on a fairly barebones app/no modifications to the code in node_modules\react-native-windows?
One idea is to try moving the project to a folder higher up the tree (e.g. C:\PackingLoading). I've seen cases where apps are in more deeply nested directories causing some build-time tools to error out when trying to write files to long paths (>260 chars). Could you try this?
@asklar. I have now moved this into the root of the C:. I have resetup the project as there was a error with the build looking in the old directory, followed the "Getting Started" steps but still having the same issues.
Log:
Hmm that's... strange, nothing obvious comes to mind. Can you try opening the C:\PackingLoading\windows\PackingLoading.sln
file in Visual Studio, select x86 or x64 in the top combobox (it defaults to ARM processors unfortunately), and press F5 to build. Do you get the same error?
Also, do you have any files under C:\PackingLoading\node_modules\react-native-windows\build\x86\Debug\Microsoft.ReactNative\Generated Files\winrt
?
If i run it though Visual Studio I get the same, it outputs on teh error list as | Severity | Code | Description | Project | File | Line |
---|---|---|---|---|---|---|
Error | WMC1006 | Cannot resolve Assembly or Windows Metadata file 'C:\PackingLoading\node_modules\react-native-windows\target\x64\Debug\Microsoft.ReactNative\Microsoft.ReactNative.winmd' | PackingLoading | C:\PackingLoading\windows\PackingLoading\PackingLoading.vcxproj | 1 | |
Error | MSB3073 | The command ""C:\PackingLoading\windows\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native....\bin\"cppwinrt @"x64\Debug\cppwinrt_ref.rsp"" exited with code 1 | PackingLoading | C:\PackingLoading\windows\packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets | 543 |
There are also files which are under C:\PackingLoading\node_modules\react-native-windows\build\x86\Debug\Microsoft.ReactNative\Generated Files\winrt
. Explorer is reporting that there are 343 items.
it sounds like your solution isn't trying to build the Microsoft.ReactNative.vcxproj project... can you confirm it is in your solution and that your app project has a reference to it under References? If the project is there, can you right click on it and select Rebuild to force it to rebuild?
The Microsoft.ReactNative.vcxproj is ticked under the solution references. I have just done a rebuild of the solution with the same error on the solutions but the project Microsoft.ReactNative has snow that the project;
winrt/Microsoft.ReactNative.h
: No such file or directoryThis was the same from when I was running it though npx react-native run-windows
In case this is a more fundamental CppWinRT issue... can you try creating a blank CppWinRT app? Then we can eliminate that as a possibility (or find our root issue there).
@chrisglein, I have tried creating a Blank App (C++/WinRT) but am unable to build this, it just keep hanging on the build but never completes. But if I go onto the App.cpp it doesnt look like the Intelisense is seeing the generated files as these are all showing up as an error. There is also a file module.g.cpp
which shows on the Solution Explorer but says the file has been renamed, deleted or moved.
@chrisglein Chris Glein FTE, I have tried creating a Blank App (C++/WinRT) but am unable to build this, it just keep hanging on the build but never completes. But if I go onto the App.cpp it doesnt look like the Intelisense is seeing the generated files as these are all showing up as an error. There is also a file
module.g.cpp
which shows on the Solution Explorer but says the file has been renamed, deleted or moved.
Unfortunately we're at the mercy of the platforms RNW is built upon, one of which is C++/WinRT. If a blank app isn't able to build then you'll need to resolve that before we'll be able to make progress on your ability to build a RNW app. It seems like something is off in your dependencies or on your system. Make sure you have free disk space and potentially try reinstalling Visual Studio and SDKs if you're unable to get a blank Windows app.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 14 days of this comment.
When running
npx react-native run-windows
in the project I keep on getting the below error. I have gone thought the system requrements and all have passed.× Building Solution: \react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]...
× Build failed with message 5>C:\Users\ryanpell\Source\Repos\PackingLoading\node_modules\react-native-windows\Microsoft.ReactNative\HResult.h(6,10): fatal error C1083: Cannot open include file: 'winrt/Microsoft.ReactNative.h': No such file or directory [C:\Users\ryanpell\Source\Repos\PackingLoading\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]. Check your build configuration.