-
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
Problem Debugging and Building React Native App Using Visual Studio #14146
Comments
Interesting. Does this build and run fine from the command line? Can you try this command in the folder?
(this is the same command as above but without If there were changes made that require new autolinking made while you were in Visual Studio, that may have drifted. And then the "check" command fails because something isn't linked that needs to be. Try that and let us know? |
Sorry but I'm new and I didn't understand the autolinking part, of course I can run that command and show you the output Here is the output of the previous command, it should be noted that I have never configured Visual Studio or any of the tools that the official React Native for Windows documentation recommends to have to meet the requirements, with this in mind I do not know if I need to configure anything more than what is documented there, although I followed the step by step of each thing and I doubt that a pre-existing configuration is causing these errors since it is my first time using the tools. Thank you very much for your attention, I hope not to bother and to be able to solve the problem and acquire new knowledge for both parties. |
@danielayala94 this error is surfacing as a problem in the telemetry exception tracking. Autolinking error is happening regardless, but it shouldn't create this additional telemetry error. @abrahamgalue you can try with If this isn't panning out it could help if you can share a repro repo so we can dig into more of your settings. |
@chrisglein I noticed that the path passed by the command in the terminal was not correct and when correcting it I got a success message, the path of the command you asked me to run was However, I think I had already run this command to run the React Native project following the official documentation @chrisglein And yes, I can see and open the file @chrisglein Sure! Here is the URL of the repository that I just uploaded to GitHub https://github.com/abrahamgalue/react-native-proyectoPrueba. I will be attentive to your next instructions and thank you very much in advance for your time! |
@chrisglein the telemetry error is indeed a bug, and the PR to fix it is here: #14191 Many thanks to @abrahamgalue for sharing his repo and repro steps, it made easier to spot the telemetry problem. Gracias! 😊 |
Great find here (and FYI #14191 is now merged). |
@chrisglein Unfortunately not, I have updated the These are the errors I get when trying to follow the same steps with which I opened the Issue: When I try to run my applicationWhen I try to build my applicationThe repository I am using is this one, thank you very much for your attention and patience. I just hope to get my application running and building it to start practicing building applications with React Native for Windows |
@danielayala94 Can you make sure that #14191 is backported to 0.76? (won't fix this, but would modify the error seen) |
I did the following and your app built and ran just fine:
|
@jonthysell I followed the steps you indicated and I got the same errors: In step 6 I got this Error: In step 8 I got this Error: In the rest of the steps I had no errors, I still don't understand what the problem is since I have followed the official React Native guide step by step and now these steps that you indicated and I keep finding errors. I really have no idea how to solve it. But thank you very much for your feedback |
I'm running out of ideas - can you run the Visual Studio Installer (it should be on your machine) and make sure Visual Studio is up to date? Then reboot? (sometimes VS isn't done setting itself up after an install/upgrade, and it doesn't tell you, but then random parts just don't work right) |
@jonthysell I tried to follow the instructions you gave me but I still get the same error, I feel that this is not the right place to discuss this problem since the issue was resolved from what I saw, so I want to thank you for the attention you gave me over these days. I don't know if I should close the Issue, please give me the answer since it is the first time I do this. If you have any suggestions of a place to ask it would be welcome 🙌. |
Problem Description
I am a new React Native user and I was following the official documentation of React Native and Microsoft https://microsoft.github.io/react-native-windows/docs/getting-started to build Windows applications using this technology. I followed the guide to create a new project from scratch, configure the development environment and install the necessary tools to carry it out. When running the project from the command
npx react-native run-windows
it worked perfectly and when I edited the code the changes were reflected on that side. My experience was satisfactory.The problem came when I wanted to build my application and I encountered problems in the Visual Studio terminal. The problems arise when I try to perform two actions from Visual Studio:
I have followed these two actions to the letter from the official documentation since I do not know of any other ways to do it.
The outputs in the Visual Studio terminal are as follows:
The command "npx --yes @react-native-community/cli autolink-windows --check --sln "windows\proyectoTrueba.sln" --proj "windows\proyectoTrueba\proyectoTrueba.vcxproj"" exited with code 9009.
The command "npx @react-native-community/cli bundle --platform windows --entry-file "index.js" --bundle-output "C:\Users\abrah\workspace\desktop\react-native\testproject\windows\testproject\Bundle\index.windows.bundle" --assets-dest "C:\Users\abrah\workspace\desktop\react-native\proyectoPrueba\windows\proyectoPrueba\Bundle" --dev false --reset-cache --sourcemap-output "C:\Users\abrah\workspace\desktop\react-native\proyectoPrueba\windows\x64\Release\proyectoPrueba\sourcemaps\react\index.windows.bundle.packager.map" --minify false" exited with code 9009.
It should be noted that I have already done the entire requirements procedure and they are all met on my machine https://microsoft.github.io/react-native-windows/docs/rnw-dependencies
I would like to solve these problems so I can build my application and continue on my learning path. Any help received would be very helpful and I would appreciate it.
Steps To Reproduce
These steps are common for both issues (Debug and Build):
npx --yes @react-native-community/cli@latest init <projectName> --version "latest"
cd <projectName>
yarn add react-native-windows@^0.76.0
npx react-native init-windows --overwrite
Using Visual Studio (Debug Problem)
npx react-native autolink-windows
yarn start
, and wait for the React Native packager to report success.Debug
->Start without Debugging
menu item.Using Visual Studio (Build Problem)
Build
->Build Solution
, orCtrl+Shift+B
Expected Results
The application is run for debugging and in the other situation the executable file is built to install the app, use it, share it with my friends or publish it.
CLI version
15.0.1
Environment
Community Modules
I'm using minimal dependencies as this is a test project from scratch:
Target Platform Version
None
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Release
Snack, code example, screenshot, or link to a repository
Debug Problem output
Release or Build Problem output
The text was updated successfully, but these errors were encountered: