How to set cordova to android target API 21 - android

how can I set the minimum and target SDK version to 21?
So far I changed it inside the Android Manifest, but still the build process shows android SDK level 19.
Thanks

As you say it doesn't react at all to changes in the manifest, you have to manually add a tag specifying the minimum sdk in the config.xml located in the project root folder.
preference name="android-minSdkVersion" value="16"
Note that this will only work if you have updated to a Cordova version which supports the target sdk.
It is all answered here:
Changing the android target of a cordova project

With Cordova 3.5.something started to go wrong to set Cordova to android target API 21 this can be used:
<platform name="android">
<preference name="android-minSdkVersion" value="21" />
</platform>
The advantage is that now you can delete the android platform and recreate it without losing any setting.

Related

How can I set the target Android SDK for Cordova?

For a new Cordova project, I want to add Android as a platform using
cordova platform add android
And I want to use Android version 16. So I set these properties in the config.xml
<preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="16" />
And I run
cordova platform add android --target android-16
Yet what I see in the logging is
Using cordova-fetch for cordova-android#~6.3.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-26
So it still targets Android 26 instead of 16. Indeed, when I run cordova build, it builds using Android version 26. Why is that? What can I do to fix this?
The syntax you use to provide android version is wrong.
Instead of
cordova platform add android --target android-16
it should be
cordova platform add android#16

Cordova android mapped to which android API

When using Cordova I want to build for Android API version 23.
When I do cordova platform add android then when I build the app by doing cordova build android. It builds for API 25 by default.
How do I go about setting the correct api version. Also mention what is to be installed in the Android-sdk.
Thanks
How do I go about setting the correct api version
In your config.xml, use a <preference> to set it:
<preference name="android-targetSdkVersion" value="23" />
Also mention what is to be installed in the Android-sdk
The API 23 platform SDK needs to be installed.
See the Cordova Android platform guide for more details.

How to build apps with minimum Android version required in Apache Cordova

I am learning Cordova by going through the docs and many blogs. I am able to create the basic skeleton of the Cordova app using cordova create, and can add the platform using cordova platform add android.
But I want to know how can I add the platform so that the apps I build will require API level 22 and above (i.e. API level not below 22)?
Add the following lines to config.xml:
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="22" />
(Cordova Android platform guide)

Unable to change Installed platforms for android in apache cordova for visual studio

I am trying to upgrade Installed platforms to android 5.0.0 in Visual Studio Tools for Apache Cordova project by using Cordova CLI command when i run command debugg path platform will upgrade to 5.0
consol screenshot
but when i again rebuild project it reset to old version 3.7.2 , yes it will reset to older version when project build but how can i upgraded android version globally so when i build it again it show upgraded android version.
i added this in config file
<preference name="android-minSdkVersion" value="21" />
<preference name="android-targetSdkVersion" value="23" />
<preference name="android-maxSdkVersion" value="23" />
installed SDK platform for API 23 in SDK manager but still same.
From the configuration file in your Cordova app, select platform and check the checkbox to use the globally installed cordova CLI version.
This update is available if your have TACO tools update 5 in VS 2015.
Hope this helps.
From the cli run: Cordova platform add #.

Force build.phonegap export app with Android 4

Are there any way to force build.phonegap export app with Android O.S Version 4.0.1 or higher?
The config.xml can be configured with minimum and maximum SDK versions:
http://build.phonegap.com/docs/config-xml
See: "Minimum and Maximum SDK Version" in "Android Specific"
ie:
<preference name="android-minSdkVersion" value="10" />

Categories

Resources