Error Command Failed: taskkill when run ionic project

Viewed 945

I try to run and emulate ionic 3 project, and generates the apk, but it does not open the emulator and it gives me the following error.

BUILD SUCCESSFUL in 7s
43 actionable tasks: 2 executed, 41 up-to-date

A:\Desktop\Applint\Nutrify\nutriapp>if "0" == "0" goto mainEnd

A:\Desktop\Applint\Nutrify\nutriapp>if "Windows_NT" == "Windows_NT" endlocal
Command finished with error code 0: A:\Desktop\Applint\Nutrify\nutriapp\platforms\android\gradlew cdvBuildDebug,-b,A:\Desktop\Applint\Nutrify\nutriapp\platforms\android\build.gradle
Built the following apk(s):
        A:\Desktop\Applint\Nutrify\nutriapp\platforms\android\app\build\outputs\apk\debug\app-debug.apk
No scripts found for hook "after_compile".
No scripts found for hook "after_build".

[ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android --verbose exited with exit code 1.

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


ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 4 functions +1ms
  ionic:lib:hooks Looking for ionic:serve:after npm script. +2m
  ionic:utils-process error while killing process tree for 16304: Error: Command failed: taskkill /pid 16304 /T /F
  ionic:utils-process ERROR: The process "16304" not found.
  ionic:utils-process
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:297:12)
  ionic:utils-process     at ChildProcess.emit (events.js:203:13)
  ionic:utils-process     at maybeClose (internal/child_process.js:1021:16)
  ionic:utils-process     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 16304 /T /F'
  ionic:utils-process } +198ms
  ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 16304 /T /F
  ionic:utils-process ERROR: The process "16304" not found.
  ionic:utils-process
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:297:12)
  ionic:utils-process     at ChildProcess.emit (events.js:203:13)
  ionic:utils-process     at maybeClose (internal/child_process.js:1021:16)
  ionic:utils-process     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 16304 /T /F'
  ionic:utils-process } +3ms
  ionic:utils-process processExit: exiting (exit code: 1) +1ms

Ever when run command, shows a different PID.

I already tried to uninstall and install Ionic and cordova globally and from the project, I ran the ionic repair command that deletes and installs the node_modules, plugins and platforms folders, and it keeps getting the same error.

My ionic Info

Ionic:

   Ionic CLI          : 6.12.3 (C:\Users\moshe\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework    : ionic-angular 3.9.10
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 8.1.0, ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-webview 4.2.1, (and 25 other plugins)

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.3.0) : 1.0.0

System:

   Android SDK Tools : 26.1.1 (C:\Users\moshe\AppData\Local\Android\Sdk)
   NodeJS            : v12.6.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.14.8
   OS                : Windows 10
0 Answers
Related