Cordova build: Please install Android target: "android-22". I dont want android-22. I want android-19 - what do I do?

Arvind picture Arvind · May 4, 2015 · Viewed 41.6k times · Source

I'm struggling with my phonegap setup and building my first app.

I created a hello1 project. I added the android project

Platform android already added

Now when I run the cordova build, I get the error -

Error: Please install Android target: "android-22"

I do not have android-22. I do have android-19. I want my project to be built with android-19. How can I make that happen?

I had android-22 which I uninstalled (for fixing a bigger problem). I do not understand which file should I be making a change in for this to work. The project.properties in the project comes after this step and it automatically contains the target as android-22.

I have added my env variables correctly. C:\Users\user\android-sdks\platform-tools;C:\Users\user\android-sdks\tools

It doesn't help. This is just part of a bigger problem that I'm trying to debug. Please help.

Answer

Honza picture Honza · Sep 19, 2015

For SDK 21 ("android-21")

$ cordova platforms remove android
$ cordova platforms add [email protected]

For SDK 22 (Android 4.1.1, "android-22")

$ cordova platforms remove android
$ cordova platforms add [email protected]

More info: https://cordova.apache.org/announcements/2015/07/21/cordova-android-4.1.0.html