• Uncategorized

About android : Android-target-not-installed-and-plugin-installation-failed-Cordova

Question Detail

I’m having issues with my Cordova installation : I installed cordova, Android Studio, Android SDK, Java and defined
JAVA_HOME="/usr/lib/jdk1.8.0_161/bin/java"
ANDROID_HOME="/home/myusername/Android/Sdk/platforms/android-24"

In /etc/environment. When I go to a Cordova project and type cordova requirments android, I have the error

Android Studio project detected

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
android: Command failed with exit code ENOENT
Gradle: installed /usr/share/gradle/bin/gradle

When I change ANDROID_HOME to /home/myusername/Android/Sdk/, the error becomes

avdmanager: Command failed with exit code 1

I can’t find the problem, I didn’t found a good answer on the other posts…

Question Answer

You have two errors:

  • the android sdk is not found

I think this is because ANDROID_HOME should be more like /home/myusername/Android/Sdk/
(the root of the sdk so that the cordova android platform will be able to choose the sdk version)

  • android command is not found in the path

you need to add to the PATH the folder where the android command is located. This should be /home/myusername/Android/Sdk/tools

i think you should try to change ANDROID_HOME to /home/myusername/Android/

Almost adding to PATH

:$HOME/Android/tools:$HOME/Android/build-tools:$Home/Android/platform-tools:$PATH

Otherwise i have export the GRADLE_HOME too.

Good Luck!

I finally found my error. I installed JAVA, but I didn’t added it to the alternatives. The solution was to add my freshly installed JAVA version as main JAVA with sudo update-alternatives --config java

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.