-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run React Native Windows App #4640
Comments
Thank you for the detailed diagnostics. @NickGerleman there's some mention of the patching targets here, can you look and see if there's something that jumps out to you? |
The target failing is the standard MSBuild file copy target. React patching happens before the rest of the build, so it's possibly acting as a bit of a canary. I.e. it feels like the issue is that we're not able to write to the build directory. One possible reason for failing to copy a file could be permissions issues. E.g. if we somehow installed the package while elevated, then tried to run the build as something non-admin, I think we could potentially see issues writing to the directory. Given we've historically required running JS tools elevated, that could be the issue. I've seen this transiently caused by antivirus locking files before as well. @ngducnghia would you mind testing the Visual Studio workflow, but running Visual Studio as an admin? I'm wondering if the CLI is seeing a different error. @asklar do you know the build your changes for better CLI error reporting went into? Was that for the internal CLI or something external? If it's for the internal CLI in vnext, we might want to consider back-porting. We really shouldn't be writing into node_modules as a build directory in the first place, and we've seen other issues from this. This should hopefully be fixed by the DLL distribution work @acoates-ms has been doing, since we can just package a DLL, but it seemed like we might not get that until 0.63. |
@NicholasCouri @chrisglein I think I found the root cause, Microsoft.ReactNative.SharedManaged project was unable to build because the path reach over 260 character limit. I move the project to outer folder to shorten the path and it seems to did the trick. I'm running into another issue with temporary certificate but I guess just delete it work. I'm now able to build and run the project. |
So I can build with VS 2019, but when I run
|
That sounds like you didn't get the signing cert created during the initial project creation. @asklar , I know you made a change to help fix this in master. But am I correct in saying that running |
@acoates-ms you shouldn't need to pass --force - we pass --force to the powershell script that sets up the cert anyway. So if you are running with my changes, you should see an elevation prompt if we need to elevate. |
@ngducnghia interesting, I haven't run into this before. The error message is coming from here
We catch an exception but we don't print out what that exception is and we don't really know which of the powershell commands failed. Could you either try running the powershell commands in that snippet from a powershell window, or add a |
@asklar I open the generator-windows/index.js in the node_modules, trying to add the log as you suggest, but then this error keep showing up on the screen
Then I run looks like I am at the last step, I have developer mode on though More info on the error when I try to run with VS Code
|
@ngducnghia that error message is best effort, it can be the developer mode failing to turn on, or as you've discovered in your case, a certificate install issue. Can you rerun the last command with |
@asklar running as you suggested, encounter error
So I open Shell in admin mode and run the command again, this time it success. Good lesson, should always try to run with logging first to see more detail on error |
Good to hear! I actually already fixed that failure in 62 (see #4570), but since you were running npx instead of the code from RNW master, you were picking up an older version of RNW which didnt have my fix. |
just realized that the elevation code I added applies to installing the app but not to enabling devmode so reactivating this |
Environment
$ npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.18362
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Memory: 947.75 MB / 7.93 GB
Binaries:
Node: 12.16.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Then, specify:
Steps to Reproduce
(Write your steps here:)
1.npx react-native init ReactWindows --version ^0.61.5
2.cd ReactWindows
3.npx react-native-windows-init --overwrite
4. npx react-native run-windows
Expected Behavior
(Write what you thought would happen.)
Actual Behavior
Try to run Without Using Visual Studio
Running MSBuild with args /clp:NoSummary;NoItemAndPropertyList;Verbosity=normal /nologo /p:Configuration=Debug /p:Platform=x86 /p:AppxBundle=Never /p:PlatformToolset=v141 /p:VisualStudioVersion=16.0 /bl
× Building Solution: Utilization: 100.0 Average Utilization: 100.0...
× Build failed with message undefined. Check your build configuration.
Try to run With Visual Studio 2019
Try to run with Visual Studio Code
Could not debug. Error while executing command 'c:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules.bin\react-native.cmd run-windows --proxy --no-packager': Error while executing command 'c:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules.bin\react-native.cmd run-windows --proxy --no-packager' (error code 101)
(Write what happened. Add screenshots!)
react-native run-windows --logging
Deferred Messages
Detailed Build Summary
============================== Build Hierarchy (IDs represent configurations) =====================================================
Id : Exclusive Time Total Time Path (Targets)
0 : 0.140s 32.873s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\windows\ReactWindows.
sln ()
| 1 : 0.011s 32.721s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\windows\ReactWindows\
ReactWindows.vcxproj.metaproj ()
| . 4 : 25.936s 32.710s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-n
ative-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj ()
| | | 5 : 1.287s 1.287s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\Common\Common.vcxproj ()
| | | 6 : 1.780s 1.780s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\Folly\Folly.vcxproj ()
| | | 7 : 1.283s 1.337s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\JSI\Universal\JSI.Universal.vcxproj ()
| | | | 10 : 0.022s 0.022s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\Common\Common.vcxproj (GetNativeManifest)
| | | . 11 : 0.032s 0.032s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\Common\Common.vcxproj (GetResolvedLinkLibs)
| | | 8 : 1.011s 1.050s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\ReactCommon\ReactCommon.vcxproj ()
| | | . 12 : 0.039s 0.039s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\Folly\Folly.vcxproj (GetNativeManifest)
| | | 9 : 1.069s 1.217s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\ReactWindowsCore\ReactWindowsCore.vcxproj ()
| | | | 13 : 0.061s 0.061s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\ReactCommon\ReactCommon.vcxproj (GetNativeManifest)
| | | | 14 : 0.038s 0.038s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\Folly\Folly.vcxproj (GetResolvedLinkLibs)
| | | . 15 : 0.048s 0.048s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\ReactCommon\ReactCommon.vcxproj (GetResolvedLinkLibs)
| | | 16 : 0.034s 0.034s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\JSI\Universal\JSI.Universal.vcxproj (GetNativeManifest)
| | . 17 : 0.067s 0.067s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\node_modules\react-nat
ive-windows\ReactWindowsCore\ReactWindowsCore.vcxproj (GetNativeManifest)
| 2 : 0.007s 0.007s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\windows..\node_module
s\react-native-windows\ReactCommon\ReactCommon.vcxproj.metaproj ()
. 3 : 0.006s 0.006s C:\Users\nghia\source\repos\React-Windows-HelloWorld\ReactWindows\windows..\node_module
s\react-native-windows\ReactWindowsCore\ReactWindowsCore.vcxproj.metaproj ()
============================== Node Utilization (IDs represent configurations) ====================================================
Timestamp: 1 Duration Cumulative
637229702341547238: 0 0.102s 0.102s ..
637229702342564518: 1 0.009s 0.111s
637229702342654290: 4 0.414s 0.525s ........
637229702346793353: 5 1.287s 1.811s .........................
637229702359658793: 6 1.781s 3.592s ...................................
637229702377471142: 7 0.120s 3.712s ..
637229702378667945: 10 0.022s 3.734s
637229702378887358: 7 0.849s 4.583s ................
637229702387374655: 11 0.032s 4.615s
637229702387693794: 7 0.315s 4.930s ......
637229702390845408: 8 0.159s 5.088s ...
637229702392431123: 12 0.039s 5.127s
637229702392820076: 8 0.853s 5.980s .................
637229702401347279: 9 0.125s 6.105s ..
637229702402593933: 13 0.061s 6.166s .
637229702403202336: 9 0.501s 6.666s ..........
637229702408208927: 14 0.038s 6.704s
637229702408587902: 15 0.048s 6.752s
637229702409066628: 9 0.445s 7.197s ........
637229702413514729: 4 0.008s 7.205s
637229702413594563: 16 0.034s 7.239s
637229702413933617: 17 0.067s 7.305s .
637229702414601834: 4 25.515s 32.820s +++++ (scale 1:100)
637229702669750161: 1 0.003s 32.823s
637229702669780269: 2 0.007s 32.830s
637229702669849906: 3 0.006s 32.836s
637229702669909705: 0 0.037s 32.873s
Utilization: 100.0 Average Utilization: 100.0
× Building Solution
× Build failed with message undefined. Check your build configuration.
Additional context
(Write any other additional context that may help in root causing the issue.)
The text was updated successfully, but these errors were encountered: