Home > Software engineering >  An error occurred while executing subprocess cordova
An error occurred while executing subprocess cordova

Time:11-26

I'm taking an IONIC Angular course, and I'm having a little problem uploading the apk project to my cell phone, I'm using cordova. As soon as I connect the cell to the computer and it's time to run the command "ionic cordova run android" it gives some errors, it could be the versions that I have installed on my computer, but I don't have enough knowledge to be sure of that, could help me?

1 enter image description here 2 enter image description here

I've tried to run several commands that I've searched on the net but I haven't had good results, it hangs at the very end

I looked for some solutions on the net but it still doesn't work, I think it's something related to the installed versions

CodePudding user response:

I posted an image just below the error that is giving now in gradle

enter image description here

CodePudding user response:

This is because the path to Android Sdk is not set correctly. Please check the correct path for Sdk, tools, platform-tools, emulator and Android build-tools.

Please, realize that the configuration recommended for Ionic has changed a bit. Now the notation recommended is as follows:

ANDROID_SDK_ROOT=/home/username/Android/Sdk (recommended setting)
ANDROID_HOME=/home/username/Android/Sdk (DEPRECATED)

In Linux or Mac OS X configure the path into the ~/.bashrc, ~/.bash_profile file:

export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/build-tools

At the end, after save the configuration dont forget to do the command:

source ~/.bashrc

or as your case

source ~/.bash_profile

For the Windows users check the global variables.

  • Related