question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cordova Build minSdkVersion change to 19

See original GitHub issue

Hello,

I have android version 7.1.1 in my project

after adding android i build project using “cordova Build” command

And i got following error

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:app:processDebugManifest FAILED

    uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] C:\Users\trikonuser\TestAgain\WebCall_AS_tsim\webCall\platforms\android\CordovaLib\build\ intermediates\manifests\full\debug\AndroidManifest.xml as the library might be using APIs not available in 16

    Suggestion: use a compatible library with a minSdk of at most 16,

            or increase this project's minSdk version to at least 19,

            or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)

Now magic is in my files www/config.xml and xml/config.xml

<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="27"/>

and main/AndroidManifest.xml file I have put <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="27" />

While My gradle file also contain

project.ext {

defaultBuildToolsVersion=“27.0.1” //String defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4 defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default }

### BUT NOW I RUN COMMAND :- CORDOVA BUILD it changes all config i mad automatically to previous as follows www/config.xml and xml/config.xml

<preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="27"/>

and main/AndroidManifest.xml file I have put <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="27" />

How Cordova Build command run rechange agin to 16 if they already want to 19

I used below phonegap version > <preference name="phonegap-version" value="cli-6.3.0" />

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

38reactions
chrisunderdowncommented, Feb 13, 2019

The problem for me was in cordova-plugin-browsertab.

You need to change line 1 of my_project/plugins/cordova-plugin-browsertab/src/android/BrowserTab.gradle to

def minSdkVersion = 19

Make sure you have the minimum SDK added to your config.xml

<preference name="android-minSdkVersion" value="19" />

Then remove and add cordova-android by:

cordova platform remove android
cordova platform add android
1reaction
starchild92commented, Feb 13, 2019

The problem for me was in cordova-plugin-browsertab.

You need to change line 1 of my_project/plugins/cordova-plugin-browsertab/src/android/BrowserTab.gradle to

def minSdkVersion = 19

Make sure you have the minimum SDK added to your config.xml

<preference name="android-minSdkVersion" value="19" />

Then remove and add cordova-android by:

cordova platform remove android
cordova platform add android

Thanks it worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cordova Build minSdkVersion change 16 to 19 - Stack Overflow
I don't know if that makes sense to you, but in this answer Ferhat mentions it might work removing the android platform and...
Read more >
How (and why) to change your Android Cordova app's ...
The default minSdkVersion in cordova apps is currently API level 19 - Android 4.4 KitKat. Your cordova app might work on Android 4.4, ......
Read more >
Android Platform Guide - Apache Cordova
This guide shows how to set up your SDK environment to deploy Cordova apps for Android devices, and how to optionally use Android-centered...
Read more >
Android – Cordova Build minSdkVersion change 16 to 19
Android – Cordova Build minSdkVersion change 16 to 19. androidcordovaphonegap-buildphonegap-plugins. I have android version 7.1.1 in my project.
Read more >
Migrating to Cordova-Android 11 - Ionic
New App Submissions: Starting on August 1, 2022, new apps must target API level 31 (Android 12) or above and adjust for behavioral...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found