Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine a suitable default value for minSdkVersion #1773

Open
insytes opened this issue Jul 11, 2023 · 4 comments
Open

Determine a suitable default value for minSdkVersion #1773

insytes opened this issue Jul 11, 2023 · 4 comments
Milestone

Comments

@insytes
Copy link

insytes commented Jul 11, 2023

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.

@NathanWalker
Copy link
Contributor

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.

@NathanWalker NathanWalker added this to the 8.6 milestone Jul 19, 2023
@edusperoni
Copy link
Collaborator

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.

@insytes
Copy link
Author

insytes commented Jul 19, 2023

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.

@Chifrica
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants