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" />
Related
I have recently started using ionic/cordova and I am currently in the process of testing my app on different android platforms. In my config.xml file, I set my minSdkVersion and targetSdk to 19 (Kitkat) and my maxSdkVersion to 26 (Oreo) like so.
<platform name="android">
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="19" />
<preference name="android-maxSdkVersion" value="26" />
When I add my android platform this carries through into the AndroidManifest.xml like it supposed to. After I run ionic cordova build android --prod --release and continue to sign the app as according to the deploying docs on the ionic site, I try installing the apk on different devices. It installs and works fine on nougat devices but on marshmallow and kitkat devices it doesn't install at all.
When I run ionic cordova platform add android --save it says:
Using cordova-fetch for cordova-android#~6.3.0 Adding android
project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.ionic.starter
Name: Lock_Ninja
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
According to other forums the change made to the config.xml file is suppose to overwrite the Android Target shown above. But despite all this, the apk only installs on nougat devices. How can i fix this?
ionic: version 3.19.0 cordova: 7.1.0 cordova-android#6.3.0
AndroidSdkBuildTols: 27.0.3
The problem has been solved here https://forum.ionicframework.com/t/apk-only-installs-on-nougat-devices/118517/2?u=uvir127
Basically the package name of app was conflicting with an already installed app with the same name
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.
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)
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 #.
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.