microsoft / vscode-cordova

A Visual Studio Code extension providing intellisense, debug, and build support for Cordova and Ionic projects.
https://marketplace.visualstudio.com/items?itemName=vsmobile.cordova-tools
Other
293 stars 68 forks source link

Spawn EINVAL error when launching Android emulator #995

Open Lukenickerson opened 2 months ago

Lukenickerson commented 2 months ago

Actual Behavior

  1. Started with an existing cordova project that had been working in the emulator in the past
  2. Created a new launch.json file with Cordova debug configuration (see https://github.com/microsoft/vscode-cordova/issues/994)
  3. Selected "Debug Android on emulator" which does a launch
  4. Selected the name of the emulator "PixelCAndroid13API33" (this seems to alter the launch.json)
  5. Emulator starts up OK
  6. Problems: (See screenshot 1 below)
    • Cordova android app does not start up
    • Error "spawn EINVAL" error is shown in debug console
    • Blue indicator on left is shown and animated (going left to right) as if there is still something happening, even though nothing is happening
    • Debug options are shown, requiring a "Stop"
  7. If I then stop the debugger, and select "Attach to running Android on emulator" from the debug menu, while the emulator is running, I get: (See screenshot 2 below)
    • Cordova android app does not start up
    • Error "Unable to find 'localabstract' name of Cordova app (error code 406)" is shown

Expected Behavior

  1. Cordova android app should start up in the emulator
  2. No "spawn EINVAL" error message, OR additional information which helps debug the underlying problem
  3. Indicator at left should not be shown if nothing is happening or the user may wait
  4. Debug options should not be shown

Software versions

Outputs (Include if relevant)

Debug (launch) error:

image

Attach error:

image

y @ console.ts:137 console.ts:137 [Extension Host] stack trace: Error: Error while executing command 'adb -s "emulator-5554" forward --remove tcp:9222': Command failed: adb -s "emulator-5554" forward --remove tcp:9222 adb.exe: error: listener 'tcp:9222' not found

at o.getNestedError (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:407832)
at .vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:415532
at ChildProcess.exithandler (node:child_process:431:5)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)

y @ console.ts:137 mainThreadExtensionService.ts:78 [msjsdiag.cordova-tools]Error while executing command 'adb -s "emulator-5554" forward --remove tcp:9222': Command failed: adb -s "emulator-5554" forward --remove tcp:9222 adb.exe: error: listener 'tcp:9222' not found

$onExtensionRuntimeError @ mainThreadExtensionService.ts:78 mainThreadExtensionService.ts:79 Error: Error while executing command 'adb -s "emulator-5554" forward --remove tcp:9222': Command failed: adb -s "emulator-5554" forward --remove tcp:9222 adb.exe: error: listener 'tcp:9222' not found

at o.getNestedError (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:407832)
at .vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:415532
at ChildProcess.exithandler (node:child_process:431:5)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
EzioLi01 commented 2 months ago

Hey @Lukenickerson , please see #985 for the details.

EzioLi01 commented 2 months ago

For the extension new version: since microsoft pipeline is updating currently, we can't release new version of extension at this stage. Will start release process immediately once pipeline updating is completely.

seamlink-aalves commented 1 month ago

Any news about the release of the new version? Using the code from the repo solves the issue.

EzioLi01 commented 1 month ago

Any news about the release of the new version? Using the code from the repo solves the issue.

Sorry, it's still in progress, this process is handled by upstream organization. Once it's completed, I will start release process immediately.

Now you can build and install you own .vsix package following this doc.