Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 404
Arvind Avatar asked May 04 '15 11:05

Arvind


4 Answers

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

like image 140
Honza Avatar answered Nov 17 '22 01:11

Honza


Change these two. I din't try it for lower versions but this worked for me in upper versions

target=android-22<br>

This should be changed in two files like below:

target=android-19<br>

Location of the two files:

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

like image 45
Shuvo Habib Avatar answered Nov 17 '22 02:11

Shuvo Habib


I am using cordova 3.5.0 which by default has target sdk as 19. You can install cordova 3.5.0 using

npm install -g [email protected]

For other versions of Cordova if you want to manually edit it you have to change this in AndroidManifest.xml file present in yourapplication/platfomrs/android.

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
like image 5
kumar Avatar answered Nov 17 '22 03:11

kumar


My problem got solved after installing SDK Platform of Andriod 5.1.1 (API 22) from Andriod Manager.

like image 4
Manoj Avatar answered Nov 17 '22 02:11

Manoj