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.

cdvMinSdkVersion seems to not work in 7.1.4

See original GitHub issue

I specified this <preference name="android-minSdkVersion" value="23" /> into config.xml, but it seems not work in 7.1.4.

I think these PRs might cause this problem.

https://github.com/apache/cordova-android/blob/a68f9fd752a25bb680da96414a3b956357c2dfcb/bin/templates/project/app/build.gradle#L125

I quickly fix this line to ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : Integer.parseInt('' + defaultMinSdkVersion). It seems to work well.

I think actual cdvMinSdkVersion is set on this line.

https://github.com/apache/cordova-android/blob/a68f9fd752a25bb680da96414a3b956357c2dfcb/bin/templates/project/app/build.gradle#L171

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
falcon8823commented, Jan 18, 2019

FYI: The workaround is to specify gradleArg when you build.

cordova build android -- --gradleArg=-PcdvMinSdkVersion=23

This will override minSdkVersion. I confirmed it works on 7.1.4.

You can confirm whether it works well using aapt command.

aapt l -a path/to/apk/android-release.apk | grep 'minSdkVersion'

5reactions
eddsktcommented, Jun 5, 2019

I solved changing lines in file: platforms/android/gradle.properties

org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m
android.useDeprecatedNdk=true
cdvMinSdkVersion=21

to

org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m
android.useDeprecatedNdk=true
cdvMinSdkVersion=19
Read more comments on GitHub >

github_iconTop Results From Across the Web

Android build issues with cordova - Stack Overflow
I have a cordova android app that I am trying to build with android version 8.1.0. While I attempt build, I see the...
Read more >
Android Platform Guide - Apache Cordova
Android Platform Guide. This guide shows how to set up your SDK environment to deploy Cordova apps for Android devices, and how to...
Read more >
Ionic Forum - Latest topics - RSSing.com
Hi guys. I have this problem when generating apk of my project. Does anyone know how to solve? cordova-android-support-gradle-release: ...
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