React Native - the debug adapter process terminated unexpectedly

I am trying to configure a debugging environment for react-native on VS code on Mac. This is launch.json :

 { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Debug iOS", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "ios", "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react", "target": "simulator" }, { "name": "Debug Android", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "android", "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" }, { "name": "Attach to packager", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "attach", "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" }, { "name": "Debug in Exponent", "program": "${workspaceRoot}/.vscode/launchReactNative.js", "type": "reactnative", "request": "launch", "platform": "exponent", "sourceMaps": true, "outDir": "${workspaceRoot}/.vscode/.react" } ] } 

When debugging, I get an error - The debug adapter process terminated unexpectedly. along with another mistake.

enter image description here

I discovered the problem on Github , but have not yet received a solution.

Update . Responding to ShaneG's answer, I add screenshots of the project diagram and info.plist

enter image description here
enter image description here

+5
source share
3 answers

Check this out: in the .vsCode folder .vsCode see if there is a .react folder .react .

If you do not, try running code . from the root directory of your project folder. You will need to install the shell command from VSCode if you have not already done so (type shift-command-p and search for Shell command: Install code command PATH ).

This was my problem, for some reason the .react folder .react not created when I opened VSCode from the spotlight.

+4
source

I see his "Debug ios", which you started. Can you make sure it points to the correct info.plist file? Many errors can occur if you point to the old info.plist. I can see in the release of GitHub that you published when you ran it from the command line, it produced a very useful error.

 An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/firstdemo.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist 

He is trying to access the bundleIdentifier, but he seems to be unable to find it. This information should be inside the info.plist file. Your application may be redirected to an old info.plist file that does not have this information.

How to check if it points to the correct info.plist?

  • First, before we go into info.plist, in xcode go to Product -> Scheme -> Change Schema. Here, go to the Run section and check what your build configuration is set to. The error above comes from Debug, so if your build configuration is set to Release. This can be a problem. This may mean that info.plist and Debug do not have this package information, because it is not built into it.

  • The "Debug Debugging" checkbox is also checked here. This may need to be checked.

  • If none of this works, although it is possible, perhaps check the info.plist file inside the project folder in xcode. See if it has a package identifier.

I would say that the Scheme section is probably the problem, so hopefully this helps you!

+1
source

Remove the React Native Tools extension from the vs code, and then reinstall it.

It works fine after that.

+1
source

Source: https://habr.com/ru/post/1273853/


All Articles