-
Notifications
You must be signed in to change notification settings - Fork 111
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
ndk-build,cargo-apk: Default target_sdk_version
to 30 or lower
#203
Conversation
cargo-apk/CHANGELOG.md
Outdated
@@ -1,5 +1,9 @@ | |||
# Unreleased | |||
|
|||
- **Breaking**: Default `target_sdk_version` to `29` or lower for more consistent | |||
interaction with Android backwards compatibility and tighter rules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of this wording, will see if I can come up with something better after a night's sleep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. @msiglreith what do you think?
I think you misread the page (which is because it's not properly updated), because it says:
So the correct level to use by default is 30, not 29, since we are now after August. And yes, that does have scoped storage implications - it enforces it on Android 11 and 12, and you need to opt out to not get enforced on Android 10 as well. |
Thanks for pointing that out. Indeed, that page literally starts out with:
Hence the confusion. Will update this. |
523ffb1
to
7446268
Compare
target_sdk_version
to 29 or lowertarget_sdk_version
to 30 or lower
023d56a
to
0bd3db8
Compare
As discussed in [197] setting `target_sdk_version` to the "arbitrary" highest available SDK version is nonsense. This target version (unlike `min_sdk_version` which defines the least set of symbols that should be available) has real impact on the runtime of an application, in particular the compatibility or stringency of rules Android applies to your application. Certain APIs may not work at all or be heavily restricted on newer target versions because they are deemed too dangerous, and Android expects the user has tested their app against these limitations and is communicating this by setting `target_sdk_version` to that particular value. Hence this shouldn't change purely based on the environment, even for the default. To retain some backwards compatibility with previous `cargo-apk` we set this to level 30 which is the least [required by Google Play] today, and exactly what users will have been targeting using NDK r22 (assuming the SDK for this `platform` was installed as well) since SDK version 31 support with NDK r23 only [arrived just last week]. [197]: #197 (comment) [required by Google Play]: https://developer.android.com/distribute/best-practices/develop/target-sdk [arrived just last week]: #189
0bd3db8
to
8a93ad9
Compare
Depends on #197
As discussed in 197 setting
target_sdk_version
to the "arbitrary" highest available SDK version is nonsense. This target version (unlikemin_sdk_version
which defines the least set of symbols that should be available) has real impact on the runtime of an application, in particular the compatibility or stringency of rules Android applies to your application. Certain APIs may not work at all or be heavily restricted on newer target versions because they are deemed too dangerous, and Android expects the user has tested their app against these limitations and is communicating this by settingtarget_sdk_version
to that particular value. Hence this shouldn't change purely based on the environment, even for the default.To retain some backwards compatibility with previous
cargo-apk
we set this to level 30 which is the least required by Google Play today, and exactly what users will have been targeting using NDK r22 (assuming the SDK for thisplatform
was installed as well) since SDK version 31 support with NDK r23 only arrived just last week.Thanks @hrydgard for bringing this to my attention!