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.
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
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
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" />
My problem got solved after installing SDK Platform of Andriod 5.1.1 (API 22) from Andriod Manager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With