Cordova Error: Please install Android target: "android-23": PhoneGap :6.0.1

Dinesh picture Dinesh · Mar 17, 2016 · Viewed 7.1k times · Source

I am trying to build apk with Phonegap 6.0.1 at path

/path/to/myproject/platforms/android/cordova

run command build --releaseget error as below enter image description here

here is screenshot of android sdk manager enter image description here enter image description here I also try change in file

yourApp/platforms/android/project.properties    
yourApp/platforms/android/CordovaLib/project.properties

target=android-23 to target=android-24
also update AndroidManifest.xml to

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="24" />

but same error

CordovaError: Please install Android target: "android-24".

can anyone help Thanks in advance for help

Answer

Julisch picture Julisch · Apr 4, 2016

I've been having this issue for a LONG TIME now and I finally got a solution for myself.

I forgot to set the ANDROID_HOME system variable. It has to be set to the directory android-sdk.

Try adding the ANDROID_HOME variable and set it to your android-sdk root directory. (not tools or platform-tools)