Search code examples
javascriptandroidcordovacross-platformhybrid-mobile-app

Cordova: Android target: not installed avdmanager: Command failed with exit code 1


I am trying to work with cordova and after installing android studio, SDK and all other requirements when I check the requirements I get the following error:

enter image description here

all solutions I found here say I should add Both JAVA_HOME and ANDROID_HOME to environment variables, also the path of tools, tools/bin and platform-tools, which I did: enter image description here and still the same error.. I dont know what to do :(

OS: Ubuntu 18.04


Solution

  • looks like I needed to also set java home in /etc/environment as follows: JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"

    and now the problem is solved:)