Cordova : [Error: Please install Android target: "android-21"

Follow these steps.
1) Type android on command line.(Make sure ANDROID_HOME and PATH are set properly)
2) Select API 21 from the populated list.
3) Click install packages.
4) Type android avd on command line.
5) Set API level and other config.
6) Now type ionic build android.


I just had the same problem. I had to change the target:

# Project target.
target=android-22

This should be done in two files:

myApp/platforms/android/project.properties myApp/platforms/android/CordovaLib/project.properties

Also the manifest should be updated:

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