Skip to content

feat(android): [minSdk 26 1] Raise minSdk from 21 to 26 - #6435

Open
runningcode wants to merge 3 commits into
no/min-sdk-26from
no/min-sdk-26-bump
Open

runningcode wants to merge 3 commits into
no/min-sdk-26from
no/min-sdk-26-bump

Conversation

@runningcode

@runningcode runningcode commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (minSdk 26)


📜 Description

Raises minSdk for all Android modules from 21 to 26. This doesn't remove the dead code.

Note: R8 version had to be forced otherwise CI failed the android integration tests. Open to other ideas on that one, see my comment in the code.

💡 Motivation and Context

💚 How did you test it?

CI Passes

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

  • Remove the SDK_INT checks made obsolete by this change and turn ObsoleteSdkInt back on (next PR in the stack)
  • Update the minimum API level in the docs and the hybrid SDKs

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into 9.x.x.

Raise the minimum supported Android API level of all Android modules
to 26. The sample and the sqlite tests no longer need to override the
floor for androidx.sqlite.

Robolectric cannot load an APK below its minSdk, so core tests now
default to API 26. Tests that only covered pre-26 code paths are
removed, and tests whose behavior differs on API 26 are adjusted.

ObsoleteSdkInt is disabled until the next change removes the checks
this makes obsolete.

Refs JAVA-547
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown

JAVA-547

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against cc24dde

@sentry

sentry Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.62.0 (1) release

⚙️ sentry-android Build Distribution Settings

The UI test app had two version checks that minSdk 26 makes obsolete.

The R8 bundled with AGP 9.0 and 9.2 crashes with a NullPointerException
in its API level database while optimizing androidx.core's
LocationManagerCompat at minSdk 26. When VERSION_AGP overrides AGP, as
in the AGP matrix, put the R8 from the default AGP 9.4.0 ahead of AGP on
the buildscript classpath.

Refs JAVA-547
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
object BuildPlugins {
val androidGradle = "com.android.tools.build:gradle:$AGP"

// The R8 bundled with AGP 9.0 and 9.2 crashes on androidx.core at minSdk 26, so builds that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably the only line that needs reviewing.

i also tried

  1. upgrading androidx.core
  2. adding a keep rule

but neither works. open to other ideas.

@runningcode
runningcode marked this pull request as ready for review October 30, 2026 14:12

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant