A very common error for Cordova users especially during installation and testing of “cordova requirements” command in MSDOS / Command Prompt
CAUSES of this cordova android error
You have probably created a project and it points to the wrong android version
You have not installed updates in your Android SDK
CORDOVA ANDROID ERROR Solution
- Move to the folder TOOLS in android eg F:\android adt\sdk\tools using MSDOS
- Run the command “Android” in your MSDOS, assuming you already set the global variables.
- This will open your Android SDK window and show you your android version as shown below
Select install packages. This requires an internet connection. The updates will be installed.
Additionally, you can view the version in tools still in the above image. Mine is 17 in this case [see my line in the image with “android 4.2.2 (API17)”]
Open these 3 files found in your project:
Android Manifests file \%appfolder%\platforms\android\AndroidManifest.xml
For all of them, change the android version and save
for example, for manifests, there is a line like this:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />/* change the 22 to your own version i.e.17*/
For the other 2 files, this is it:
# Project target. target=android-22 /* change this to your version too - 17*/
Save all and try running command again. A restart would be the last option.