ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Ionic Error: An error occurred while running subprocess cordova

Open ionitron-bot[bot] opened this issue 8 years ago • 11 comments

hello All I am getting following error when i try to run App in ionic emulater android or browser. Also below you can find my ionic Info Same result: is for ionic cordova emulate android --prod

C:\IonicApp\LIMSApp>ionic cordova run browser --verbose ionic:cli-utils Terminal info: { tty: true, ci: false } +0ms ionic:cli-utils CLI global options: { _: [ 'cordova', 'run', 'browser' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +4ms ionic:cli-utils:lib:project Project type from config: Ionic Angular 3 (ionic-angular) +0ms ionic:cli-utils Project name: undefined +237ms ionic:cli Context: { binPath: 'C:\Users\User\AppData\Roaming\npm\node_modules\ionic\bin\ionic', libPath: 'C:\Users\User\AppData\Roaming\npm\node_modules\ionic', execPath: 'C:\IonicApp\LIMSApp', version: '4.1.2' } +0ms ionic:cli-utils:lib:integrations:cordova:config Using config.xml: C:\IonicApp\LIMSApp\config.xml +0ms

cordova platform add browser --save internal/modules/cjs/loader.js:583 throw err; ^

Error: Cannot find module 'loud-rejection/register' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (C:\Users\User\AppData\Roaming\npm\node_modules\cordova\bin\cordova:22:1) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) [ERROR] An error occurred while running subprocess cordova.

cordova platform add browser --save exited with exit code 1.

Re-running this command with the --verbose flag may provide more information.

ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms ionic:cli-framework:utils:process onBeforeExit handler: running 1 queued functions +1ms ionic:cli-framework:utils:process error while killing process tree for 9764: { Error: Command failed: taskkill /pid 9764 /T /F ionic:cli-framework:utils:process ERROR: The process "9764" not found. ionic:cli-framework:utils:process ionic:cli-framework:utils:process at ChildProcess.exithandler (child_process.js:276:12) ionic:cli-framework:utils:process at emitTwo (events.js:126:13) ionic:cli-framework:utils:process at ChildProcess.emit (events.js:214:7) ionic:cli-framework:utils:process at maybeClose (internal/child_process.js:915:16) ionic:cli-framework:utils:process at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) ionic:cli-framework:utils:process killed: false, ionic:cli-framework:utils:process code: 128, ionic:cli-framework:utils:process signal: null, ionic:cli-framework:utils:process cmd: 'taskkill /pid 9764 /T /F' } +112ms ionic:cli-framework:utils:process Error from function 0 in exit queue: { Error: Command failed: taskkill /pid 9764 /T /F ionic:cli-framework:utils:process ERROR: The process "9764" not found. ionic:cli-framework:utils:process ionic:cli-framework:utils:process at ChildProcess.exithandler (child_process.js:276:12) ionic:cli-framework:utils:process at emitTwo (events.js:126:13) ionic:cli-framework:utils:process at ChildProcess.emit (events.js:214:7) ionic:cli-framework:utils:process at maybeClose (internal/child_process.js:915:16) ionic:cli-framework:utils:process at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) ionic:cli-framework:utils:process killed: false, ionic:cli-framework:utils:process code: 128, ionic:cli-framework:utils:process signal: null, ionic:cli-framework:utils:process cmd: 'taskkill /pid 9764 /T /F' } +3ms ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 1) +4ms

C:\IonicApp\LIMSApp>ionic info √ Gathering environment info - done!

Ionic:

ionic (Ionic CLI) : 4.1.2 (C:\Users\User\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic-angular 3.1.1 @ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : not installed Cordova Platforms : not available Cordova Plugins : not available

System:

NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe) npm : 6.4.1 OS : Windows 7

ionitron-bot[bot] avatar Oct 05 '18 21:10 ionitron-bot[bot]

@baljeetkalsi I would try reinstalling Cordova.

npm uninstall -g cordova
npm install -g cordova

imhoffd avatar Oct 05 '18 21:10 imhoffd

@baljeetkalsi it's not working screen

sshubham730 avatar Oct 09 '18 04:10 sshubham730

@cronshubham you just need to install your android SDK/build tools. It's not the issue of Cordova/ionic. Run 'android' to start Android SDK Manager. And install what is suggested in the screenshot you've posted above.

EugeneNews avatar Oct 09 '18 05:10 EugeneNews

@EugeneNews

@cronshubham you just need to install your android SDK/build tools. It's not the issue of Cordova/ionic. Run 'android' to start Android SDK Manager. And install what is suggested in the screenshot you've posted above.

i'm confused. Should I run android studio or run command prompt 'android' and do i need to download android sdk

sshubham730 avatar Oct 09 '18 06:10 sshubham730

@baljeetkalsi I would try reinstalling Cordova.

npm uninstall -g cordova
npm install -g cordova

I did same 2 time but Noting is working ..

baljeetkalsi avatar Oct 09 '18 13:10 baljeetkalsi

@cronshubham you just need to install your android SDK/build tools. It's not the issue of Cordova/ionic. Run 'android' to start Android SDK Manager. And install what is suggested in the screenshot you've posted above.

I already have Android SDK manager. Can you explain in more detail about what need to be changed in it.

baljeetkalsi avatar Oct 09 '18 13:10 baljeetkalsi

I got this issue today as well, although the build is successfully done but it shows me the same error message


BUILD SUCCESSFUL in 25s
50 actionable tasks: 28 executed, 22 up-to-date
Built the following apk(s):
        ~/Desktop/myApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Crosswalk info:
        After much discussion and analysis of the market,
        we have decided to discontinue support for Android 4.0 (ICS) in Crosswalk starting with version 20, so the minSdkVersion of Cordova project is configured to 16 by default.

[ERROR] An error occurred while running subprocess cordova.

        cordova build android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

tomavic avatar Oct 10 '18 12:10 tomavic

@tomavic Maybe crosswalk is making the Cordova CLI exit with an error code. In any case, we can't really support Crosswalk anymore. It's an abandoned project.

imhoffd avatar Oct 10 '18 16:10 imhoffd

@tomavic try this 3 commands: ionic cordova platform rm android ionic cordova platform add [email protected] ionic cordova build android

JAYARATHNARAVI avatar Oct 12 '18 06:10 JAYARATHNARAVI

I'm getting this error on all "ionic cordova ..." commands: ionic cordova run android ionic cordova build ios ionic cordova platform add etc

My ionic info:

✔ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)  : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.1, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 6 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/francovalerio/Library/Android/sdk)
   ios-deploy        : 2.0.0
   NodeJS            : v8.11.2 (/usr/local/bin/node)
   npm               : 6.4.0
   OS                : macOS
   Xcode             : Xcode 9.4.1 Build version 9F2000

francovp avatar Oct 12 '18 13:10 francovp

This error is a message from the Ionic CLI saying that the Cordova CLI exited with an error. Everyone in this issue has a different root issue, unrelated to the Ionic CLI. Now that this issue is beginning to get traction from Google, I'm going to lock it.

If you get the "An error occurred while running subprocess cordova" error:

  • Look above in your terminal for the real error. It is being printed by Cordova. Google that instead.
  • You will have much better luck asking for support for your issue in the forums. See our support page for more options.

imhoffd avatar Oct 12 '18 15:10 imhoffd