question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ionic Error: An error occurred while running subprocess cordova

See original GitHub issue

Description:

Running ionic cordova build... command errors with output like below

...
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 8.893 secs
Command finished with error code 0: /Users/marqueswoodson/Projects/platforms/android/gradlew cdvBuildDebug,-b,/Users/marqueswoodson/Projects/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true,-PcdvCompileSdkVersion=android-28
Built the following apk(s):
	/Users/marqueswoodson/Projects/platforms/android/build/outputs/apk/android-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 build android --verbose -- --gradleArg=-PcdvCompileSdkVersion=android-28 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 2 queued functions +0ms
  ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 1) +72ms

The actual build does work, as you can see above. There’s no errors in the output.

Steps to Reproduce:

Try building an android project with ionic 4.x.

If I run the above without the ionic keyword:

cordova build android --verbose -- --gradleArg=-PcdvCompileSdkVersion=android-28

it works fine.

Output:

My ionic info:

Ionic:

   ionic (Ionic CLI) : 4.1.2 (/Users/marqueswoodson/.nvm/versions/node/v8.9.4/lib/node_modules/ionic)
   Ionic Framework   : unknown
   @ionic/v1-toolkit : 1.0.10

Cordova:

   cordova (Cordova CLI) : 7.1.0
   Cordova Platforms     : android 6.3.0
   Cordova Plugins       : no whitelisted plugins (25 plugins total)

System:

   Android SDK Tools : 26.1.1 (/Users/marqueswoodson/android-sdk)
   NodeJS            : v8.9.4 (/Users/marqueswoodson/.nvm/versions/node/v8.9.4/bin/node)
   npm               : 2.15.12
   OS                : macOS High Sierra
   Xcode             : Xcode 10.0 Build version 10A255

Other Information:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
shahrulhaniffcommented, Oct 23, 2018

in case of others who still not fixed yet, I remove the platform folder, then run the cmd again. Its work fine with me

0reactions
imhoffdcommented, Nov 1, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR: An error occurred while running subprocess cordova
This is because the path to Android Sdk is not set correctly. Please check the correct path for Sdk, tools, platform-tools, emulator and ......
Read more >
An error occurred while running subprocess cordova ... - GitHub
hello All I am getting following error when i try to run App in ionic emulater android or browser. Also below you can...
Read more >
[ERROR] An error occurred while running subprocess cordova
while running build command ionic cordova build android --verbose I am getting an error for Cordova due to I am not able to...
Read more >
An error occurred while running subprocess cordova in ionic 4
This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. ... * Try: Run...
Read more >
[ERROR] An error occurred while running subprocess cordova
Ionic 3: [ERROR] An error occurred while running subprocess cordova · Información. · Actualizar la plataforma iOS o Android. · Simular con run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found