NativeScript / android

Android runtime for NativeScript (based on V8)

Home Page:https://docs.nativescript.org/guide/android-marshalling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Determine a suitable default value for minSdkVersion

insytes opened this issue · comments

The minSdkVersion is currently set to 17 (Android-4 2012).

When building the app with a common plugin like @nativescript/background-http the build will fail.

Execution failed for task ':app:processDebugMainManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 17 cannot be smaller than version 21 declared in library [net.gotev:uploadservice:4.7.0] /Users/ianbrindley/.gradle/caches/transforms-3/24fa1312ea1be6efbab27240facdcfb1/transformed/jetified-uploadservice-4.7.0/AndroidManifest.xml as the library might be using APIs not available in 17
        Suggestion: use a compatible library with a minSdk of at most 17,
                or increase this project's minSdk version to at least 21,
                or use tools:overrideLibrary="net.gotev.uploadservice" to force usage (may lead to runtime failures)

Instead I have to add additional configuration to gradle to get this plugin to work.

I suggest that the minSdkVersion is set to 21.

Thank you @insytes I have to agree; I've believed the min should be 21 for quite awhile now - certainly as the default - you could set a min to 17 or 19 on your own - Hope this is adjusted for next minor/major release.

Having to configure minTargetSdk isn't unreasonable. It's actually really common and some libraries will require min version of 24, which is definitely not something we would be comfortable doing.

The runtime is the lowest level of NativeScript and it has to support the widest variety of cases. While you need android 21, the runtime supports even android 4.2 while there aren't many devices in 4.2 or 4.4 (<2%), some projects target those versions specifically as a lot of enterprise or warehouse tablets are on Android 4.4 still.

I think that maybe on NativeScript 9 or 10 we could bump this, as 4.4 has around 0.5% usage these days, but this decision can't be taken lightly as supporting old android versions is a requirement on some projects and the "workaround" for newer projects is a single line in the Gradle file.

Having to configure minTargetSdk isn't unreasonable. It's actually really common and some libraries will require min version of 24, which is definitely not something we would be comfortable doing.

The runtime is the lowest level of NativeScript and it has to support the widest variety of cases. While you need android 21, the runtime supports even android 4.2 while there aren't many devices in 4.2 or 4.4 (<2%), some projects target those versions specifically as a lot of enterprise or warehouse tablets are on Android 4.4 still.

I think that maybe on NativeScript 9 or 10 we could bump this, as 4.4 has around 0.5% usage these days, but this decision can't be taken lightly as supporting old android versions is a requirement on some projects and the "workaround" for newer projects is a single line in the Gradle file.

Thanks @edusperoni, I agree with you that configuring "minTargetSdk isn't unreasonable" and perhaps this issue isn't pertinent to supporting real world devices.

I did actually notice the value of NS_DEFAULT_MIN_SDK_VERSION compared to Statcounter GlobalStats also seemed reasonable.

Putting this one down to QA.

I second you @edusperoni, well they can make the minimum to be version to be 8.0 using version 33 api. I think this will be better because android is growing very fast in there development.