On Visual Studio Code ( version 1.0.0) installed with React Native Tools plugin (version 0.1.4), when it run & debug a React Native app ( with Debug iOS option is checked), the app run successfully on iOS Simulator but VS Code is failing debug the app. It shows several error messages in its debug panel.
react-native init SampleAllnpm start command inside the the React Native Application's directory, in a terminal window.

Debug iOS option

Several error messages are shown in the DEBUG CONSOLE panel.
No error happen.
Delete everything inside ios/build ( you can use rm -rf ** inside ios/build folder inside your project). Seems prior build's artefacts could cause this issue.
What happens if you run react-native run-ios in the project root? We try not to do anything fancy when compiling the project, so we should work if react-native CLI does.
Secondly, when using this extension we try to manage the packager (so we can configure debugging) so you should not npm start in the project. If you ensure that react-native run-ios compiles and runs the app, and that the react-native packager is not running prior to trying to debug with VS Code, then it should work out. If not, we'll check it out further.
Hello @MSLaguana
"What happens if you run react-native run-ios in the project root? "
In this case, I have not stop the RN Packager ( the one I ran usingnpm startcommand on other terminal window ). I runreact-native run-iosin the project on other terminal window. It shows 'Build Failed' log. Here is the screenshot:
"..If you ensure that react-native run-ios compiles and runs the app, and that the react-native packager is not running prior to trying to debug with VS Code, then it should work out. "
- I close the VS Code. I re-run npm install inside the RN Project Folder then run
react-native run-iosas well. The result was I still could see 'error: PCH was compiled with module cache path' as seen in the attached screenshot. However, the weird thing is, it seems that it could build project and run the app on the ios simulator- I stopped the react native packager server. Open the project in VS Code and redo the replication steps i mentioned earlier. The result is same error still happen. Here is the screenshot
Cheers.
Your application is failing to compile, which is unrelated to our VSCode extension.
At a guess, if you got the sample app pre-built somewhere, you could try deleting ios/build which contains intermediate build objects and that may help.
Hello @MSLaguana
".. you could try deleting ios/build which contains intermediate build objects and that may help."
I did your suggestion, runreact-native run-ioscommand and the build error did not happen anymore. Awesome @MSLaguana !
Back to the main issue, I tried your suggestion to stop react packager server then tried to debug the app from VS Code. The result is the issue did not happen anymore. My VS Code has entered debugging mode successfullly. Again, Thanks for your support @MSLaguana . I will update (by adding 'Resolution' section', in case some people encountered this issue in the future) and close this issue.
Cheers
The issue has been resolved by following @MSLaguana 's suggestion.
Thank you @MSLaguana! You saved my day haahha
Hello @MSLaguana It ddn't worked in my case rather it gave the following error :
The following commands produced analyzer issues:
Analyze Base/RCTModuleMethod.mm
Analyze Modules/RCTUIManager.m
Beside that I also have try deleting and reinstalling node_modele , podfile.lock and pods but the error is the same.
Please help me if there is any other way out .
Thank you
Hi @khadkaPratik are you able to compile and run your React Native app via react-native run-ios?
@ruslan-bikkinin Hello sir,
I really don't know what is going on with my project I am just roaming around with different error . I figure out that the error is actually in my podfile which is not letting me install and pod packages .
because of which there are still some issue related to GoogleMapBase, GooglePlacePicker.
Just delete all contents inside build folder. clean everything and run again.
@khadkaPratik please clarify can you compile and run project via react-native run-ios?
Hello @ruslan-bikkinin Yes I am able to run react-native run-ios but then the simulator runs and stops at splash screen and @muzammil-triffort yes i have already tried to do that but it ddn't worked.
The only thing I have to do in this project is to compile all the prebuild project in ios but there are several issues after my friend add google sign in on his android project and pushed it to the repo .
@khadkaPratik your issue might be related to new installed libraries only. You have to figure out that.
Most helpful comment
Your application is failing to compile, which is unrelated to our VSCode extension.
At a guess, if you got the sample app pre-built somewhere, you could try deleting ios/build which contains intermediate build objects and that may help.