Skip to content

ref(android): Remove deprecated io.sentry.android.core.LoadClass - #6594

Merged
adinauer merged 3 commits into
9.x.xfrom
ref/remove-deprecated-android-loadclass
Nov 12, 2026
Merged

adinauer merged 3 commits into
9.x.xfrom
ref/remove-deprecated-android-loadclass

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Removes the deprecated io.sentry.android.core.LoadClass shim. io.sentry.util.LoadClass has the same methods and can be dropped in as a replacement.

  • Deletes sentry-android-core/.../LoadClass.java. It extended io.sentry.util.LoadClass and forwarded loadClass / isClassAvailable to a separate delegate instance.
  • AndroidOptionsInitializer, SentryAndroid and UserInteractionIntegration had to spell out io.sentry.util.LoadClass because the shim shadowed the name inside io.sentry.android.core. They now import it instead.
  • Tests in the io.sentry.android.core package silently resolved LoadClass() / mock<LoadClass>() to the deprecated shim. They now import io.sentry.util.LoadClass.
  • sentry-android-core.api was regenerated.

💡 Motivation and Context

The shim was deprecated in #3460 (June 2024, before 8.0) in favor of io.sentry.util.LoadClass. No SDK production code uses it anymore. Since 9.0 is a major release, this is a good time to remove it.

Hybrid SDKs: sentry-react-native already uses io.sentry.util.LoadClass. GitHub code search found no references to io.sentry.android.core.LoadClass in sentry-dart, sentry-unity, sentry-capacitor, sentry-kotlin-multiplatform, sentry-unreal or sentry-dotnet. Code search isn't exhaustive, so this is worth a quick double-check.

💚 How did you test it?

  • ./gradlew :sentry-android-core:spotlessApply :sentry-android-core:updateKotlinAbi passed. It compiles main sources; the .api diff only drops the shim class.
  • I did not run the affected sentry-android-core unit tests locally, so I'm relying on CI. The test changes are imports only.
  • The first CI run failed only because 9.x.x didn't compile (SentryTracer still called span.getOptions()). That was fixed in fix(core): Fix 9.x.x compile error in SentryTracer.hasAllChildrenFinished #6595. This branch now includes the latest 9.x.x (4066c5e), and CI is re-running.

📝 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

  • Merge once CI on the updated branch is green.
  • If needed, add a line to the 9.0 migration guide in sentry-docs.

via alexander.dinauer.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 12, 2026 11:16
Use io.sentry.util.LoadClass instead. The Android shim was deprecated in

Co-Authored-By: Alexander Dinauer <alexander.dinauer@sentry.io>
#3460 and nothing in the SDK uses it anymore.
Co-Authored-By: Alexander Dinauer <alexander.dinauer@sentry.io>
@adinauer
adinauer marked this pull request as ready for review November 12, 2026 11:18
@adinauer
adinauer requested review from a team and adinauer as code owners November 12, 2026 11:18
@adinauer
adinauer requested review from markushi and runningcode and removed request for a team November 12, 2026 11:18

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love the 🔥

@sentry

sentry Bot commented Nov 12, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@adinauer
adinauer merged commit d3b29ed into 9.x.x Nov 12, 2026
42 of 43 checks passed
@adinauer
adinauer deleted the ref/remove-deprecated-android-loadclass branch November 12, 2026 13:07
adinauer added a commit to getsentry/sentry-docs that referenced this pull request Nov 12, 2026
## DESCRIBE YOUR PR

Document the removal of the deprecated
`io.sentry.android.core.LoadClass` shim in the Android v8-to-v9
migration guide.

The guidance tells users to replace imports of the removed Android class
with `io.sentry.util.LoadClass`, which provides the same constructor and
methods.

This PR targets the `java-v9` collection branch so the migration
guidance publishes with SDK v9.

Refs getsentry/sentry-java#6594

## 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+

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants