[Bug] Android debugging get spawn EINVAL error in windows, vscode 1.92
🐛 What is the bug? How can we reproduce it?
In visual studio code 1.92.0 or 1.92.1 windows 11 or 10 when debugging android is launched display error: An error occurred while launching the application. spawn EINVAL (error code 303)
doing some research is linked to the indicated security change:
https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
Hey @uganof , thanks for reporting it. The bug fixing is in progress, any updates will comment here.
As a workaround, you can use native command npx react-native run-android to launch you application and use attach request to debug your app.
{
"name": "Attach to Hermes application",
"request": "attach",
"type": "reactnativedirect",
"cwd": "${workspaceFolder}"
}
Thank you!
Hey @uganof , this issue should be fixed. Could you please uninstall existing extension and try on this one(Unzip and manually install .vsix file in vscode extension tab)? Any issue please let me know.
Hi @lexie011, I installed the extension you attached and now it works correctly as before. Thank you
@uganof Please use this extension for the debugging, currently microsoft pipeline is updating, after this we will work on new version release process.
@uganof I'm getting an error trying to use this extension. Pls provide me the solution.
[Info] Need to check main file and entry point of open module, will setup and write new content if they're not existing. Path: d:\new\admin project\admin\node_modules\open
[Info] Find open-main.js and entry in open module, skip setup...
[Info] Starting Packager
'd:\new\admin' is not recognized as an internal or external command, operable program or batch file.
@uganof I'm getting an error trying to use this extension. Pls provide me the solution.
[Info] Need to check main file and entry point of open module, will setup and write new content if they're not existing. Path: d:\new\admin project\admin\node_modules\open
[Info] Find open-main.js and entry in open module, skip setup...
[Info] Starting Packager
'd:\new\admin' is not recognized as an internal or external command, operable program or batch file.
Maybe you can rename folder without space. Like 'AdminProject', not 'admin project'.
Still doesn't work for my iOS. It just stuck after I click Attach to package
Hey @uganof , thanks for reporting it. The bug fixing is in progress, any updates will comment here.
As a workaround, you can use native command
npx react-native run-androidto launch you application and useattachrequest to debug your app.{ "name": "Attach to Hermes application", "request": "attach", "type": "reactnativedirect", "cwd": "${workspaceFolder}" }
This one works. Thanks.
Hey @uganof , thanks for reporting it. The bug fixing is in progress, any updates will comment here.
As a workaround, you can use native command
npx react-native run-androidto launch you application and useattachrequest to debug your app.{ "name": "Attach to Hermes application", "request": "attach", "type": "reactnativedirect", "cwd": "${workspaceFolder}" }
But which option to run to attach to android emulator ? all options give error
@Master-Servis Have you installed extension mentioned in this comment?
As mentioned in above related issue, the new version of extension is not released since MS is working on updating pipeline security policy and it's still in progress.
Also you can try to package and install your own .vsix file following this doc.
Will publish new version of extension once the pipeline is getting back.
Also you can try to package and install your own .vsix file following this doc.
Hi, extension did not work for me. I did the following:
Ran command npx react-native start --experimental-debugger
Then put json config:
{
"configurations": [
{
"name": "Attach to Hermes application - Experimental",
"request": "attach",
"type": "reactnativedirect",
"cwd": "${workspaceFolder}",
"address": "localhost",
"port": 8081
}
]
}
And clicked run in debugger on top of already running reactapp.
That worked. Thanks.
Ref: https://github.com/microsoft/vscode-react-native/issues/1878#issuecomment-1334686256
Hey @uganof , this issue should be fixed. Could you please uninstall existing extension and try on this one(Unzip and manually install .vsix file in vscode extension tab)? Any issue please let me know.
Just to let you know, this is still happening with the last VSC version from the Extensions marketplace. I had to download your zip version in order to be able to debug and run the react native application on desktop (targeting widnows platform).
Move this issue in #2254.
Hey @uganof , this issue should be fixed. Could you please uninstall existing extension and try on this one(Unzip and manually install .vsix file in vscode extension tab)? Any issue please let me know.
Just made my day. Thanks
So May 2025, I am still getting "Failed to start the React Native packager (error code 106)". I see the version of this hasn't changed in a year. Is it still a MS pipeline issue? any word on when newer versions of react native tools can be updated normally?
Looks like I will have to install the .zip, for now, just shocked that these comments are from so long ago.
For me, it works with @EzioLi01 solution, just a little note, remember that the local server should be started.
Said that, try to run yarn start, before attach or as the solution mentioned run npx react-native run-android.