Skip to content
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

Spawn EINVAL error when launching Android emulator #995

Open
Lukenickerson opened this issue Aug 29, 2024 · 4 comments
Open

Spawn EINVAL error when launching Android emulator #995

Lukenickerson opened this issue Aug 29, 2024 · 4 comments

Comments

@Lukenickerson
Copy link

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 Readme documentation is outdated for VS Code 1.92.2, and debugger selection does not work #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

  • Cordova VS Code extension version: 2.7.0
  • VSCode version: 1.92.2
  • OS platform and version: Windows 10
  • NodeJS version: 20.5.0
  • Cordova version: 12.0.0
  • Cordova-Android/iOS/Windows version: 13.0.0

Outputs (Include if relevant)

Debug (launch) error:

image

Attach error:

image

  • Output of the Debug Console (View -> Toggle Debug Console):
Launching for android (This may take a while)...
spawn EINVAL
  • Output of the Cordova output channel (View -> Toggle Output -> Select Cordova in ListBox):
Launched emulator PixelCAndroid13API33
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
register @ TMScopeRegistry.ts:46
log.ts:419  INFO [perf] Render performance baseline is 53ms
webviewElement.ts:482 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:482
workbench.html:1 Third-party cookie will be blocked. Learn more in the Issues tab.
webviewElement.ts:482 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:482
webviewElement.ts:482 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:482
webviewElement.ts:482 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:482
log.ts:439   ERR [Extension Host] Error while detecting Ionic CLI version TypeError: Cannot read properties of null (reading 'toString')
	at h.getIonicCliVersion (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:527569)
	at h.isIonicCliVersionGte (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:527659)
	at new f (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:533857)
	at F.<anonymous> (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:450534)
	at Generator.next (<anonymous>)
	at s (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:441086)
console.ts:137 [Extension Host] Error while detecting Ionic CLI version TypeError: Cannot read properties of null (reading 'toString')
	at h.getIonicCliVersion (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:527569)
	at h.isIonicCliVersionGte (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:527659)
	at new f (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:533857)
	at F.<anonymous> (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:450534)
	at Generator.next (<anonymous>)
	at s (.vscode\extensions\msjsdiag.cordova-tools-2.7.0\dist\cordova-extension.js:4:441086)
y @ console.ts:137
console.ts:137 [Extension Host] rejected promise not handled within 1 second: 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

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
Copy link
Collaborator

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

@EzioLi01
Copy link
Collaborator

EzioLi01 commented Aug 30, 2024

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
Copy link

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

@EzioLi01
Copy link
Collaborator

EzioLi01 commented Oct 8, 2024

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.

@github-staff github-staff deleted a comment from rodeok Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants