Repository navigation
enh(android): Lower Android minSdk to 24 - #4150
Conversation
Align the plugin's minSdk with Flutter 3.44's default flutter.minSdkVersion (24) so apps using the Flutter default build without raising minSdk. Nothing in the plugin, the JNI bindings, or sentry-android 8.63.0 requires API 26; Session Replay already disables itself below API 26. Co-Authored-By: Gino Buenaflor <[email protected]>
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Fixes
Enhancements
DependenciesDeps
Internal ChangesRelease
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4150 +/- ##
==========================================
+ Coverage 89.11% 93.12% +4.00%
==========================================
Files 354 119 -235
Lines 12795 4812 -7983
==========================================
- Hits 11402 4481 -6921
+ Misses 1393 331 -1062
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
🔵 Needs a closer look
Restoring Android API 24–25 support crosses JNI/native boundaries without device runtime validation, while Android-team agreement on the lowered baseline remains unresolved.
No open issues 🎉
What changed in this PR
Lowers the Flutter SDK’s Android minimum from API 26 to API 24, aligning with Flutter 3.44’s default and avoiding manifest-merge failures for apps using that default.
Changes:
- Sets
sentry_flutter’s AndroidminSdkVersionto 24. - Restores
flutter.minSdkVersionin the example, microbenchmark, and minimum-version test apps.
Runtime validation on API 24 remains pending, as noted in the PR description.
| File | Description |
|---|---|
packages/flutter/microbenchmarks/android/app/build.gradle |
Uses Flutter’s default minimum Android SDK. |
packages/flutter/example/android/app/build.gradle |
Uses Flutter’s default minimum Android SDK. |
packages/flutter/android/build.gradle |
Lowers the plugin’s minimum Android SDK to 24. |
min_version_test/android/app/build.gradle |
Uses Flutter’s default minimum for compatibility builds. |
Review effort: Balanced
<!-- Keep the urgency section so automation can prioritize this PR. You may delete other sections you don't need. --> ## DESCRIBE YOUR PR `sentry_flutter` 10.4.0 lowered the minimum Android SDK version from API 26 to API 24, matching Flutter's default `minSdk` (getsentry/sentry-dart#4150). The docs still say API 26 in three places, which tells users (and coding agents) to raise `minSdk` when they don't need to. Changes: - `includes/migration/flutter-v10/minimum-versions.mdx`: v10 minimum is now `24`, with a note that 10.0.0–10.3.x require API 26. - `includes/flutter-v10-migration-overview.mdx`: same correction in the overview. - `platform-includes/getting-started-prerequisites/dart.flutter.mdx`: getting started prerequisites now say API 24. **Verified:** `sentry_flutter` 10.5.0's `android/build.gradle` declares `minSdkVersion 24`. A fresh Flutter 3.44.1 app (default `minSdk` 24) with `sentry_flutter` ^10.5.0 built, ran on an Android emulator and sent events to Sentry. **How we found it:** coding agents following the docs via `sentry init` raised `minSdk` to 26 in 6/6 runs, while the wizard's setup at API 24 worked fine. Context: getsentry/sentry-react-native#7064. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
## DESCRIBE YOUR PR The v10 migration guide's package example changes from `sentry_flutter: ^10.0.0` to `^10.4.0`. #20882 already lowered the documented Android minimum to API 24, and it notes that 10.0.0 to 10.3.x still need API 26. The `^10.0.0` example still accepts those releases, so someone who follows the guide on API 24 or 25 can resolve to a version that fails the Android manifest merge. [getsentry/sentry-dart#4150](getsentry/sentry-dart#4150) shipped in 10.4.0. This PR first changed the prerequisites, migration overview, and minimum-versions table from 26 to 24. #20882 made the same changes with release qualifiers, so when I resolved the merge conflict I kept master's version. Only the package example change is left. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) <!-- junior-request-attribution:start --> via **Gino Buenaflor**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0AND00ESR2%3A1794322085.249379 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0AND00ESR2%3A1794322085.249379) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0AND00ESR2%3A1794322085.249379/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Gino Buenaflor <[email protected]>
📜 Description
Lowers the
sentry_flutterAndroidminSdkVersionfrom 26 to 24. The example, microbenchmarks, andmin_version_testapps go back toflutter.minSdkVersion, as they were before #4049.💡 Motivation and Context
v10 raised the minimum to 26 (#4049). Flutter 3.44, our minimum supported version, defaults
flutter.minSdkVersionto 24. That means an app using Flutter's default fails the Android manifest merge with v10 until the developer raises minSdk by hand.This change is not breaking: apps already on minSdk 26 or higher are unaffected. We checked the following for code that needs API 26:
activity.display, API 30) already has anSDK_INTcheck.Context,Bitmap.createBitmap(w, h, ARGB_8888),Bitmap.copyPixelsFromBuffer, andjava.net.Proxy. All of these work below API 26.sentry-android8.63.0 andpackage:jniboth declare minSdk 21.ReplayIntegration.register()exits early below API 26, and start, buffering, and screenshot calls check that it is enabled. On API 24 and 25, Replay, including the new manual controls, does nothing instead of crashing.Changelog Entry
minSdk.💚 How did you test it?
I only reviewed the code. I didn't run an app on a device. Before merging, run
min_version_testCI and a quick smoke test on an API 24 emulator: init, capture an event, a native crash, and check that Replay stays off.via Gino Buenaflor.
--
View Session [Sentry]