feat(android): Warn when Gradle resolves unexpected sentry-android version#6194
Closed
antonis wants to merge 1 commit into
Closed
feat(android): Warn when Gradle resolves unexpected sentry-android version#6194antonis wants to merge 1 commit into
antonis wants to merge 1 commit into
Conversation
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
Plus 18 more 🤖 This preview updates automatically when you update the PR. |
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Warn when Gradle resolves unexpected sentry-android version ([#6194](https://github.com/getsentry/sentry-react-native/pull/6194))If none of the above apply, you can opt out of this check by adding |
Adds a runtime warning when the resolved sentry-android version differs from what @sentry/react-native expects, which can happen when the Sentry Android Gradle Plugin's autoInstallation overrides the pinned version. Closes #3671 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8795974 to
4f27bb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Adds a runtime warning (logged at
SentryLevel.WARNING) when the resolvedsentry-androidversion differs from what@sentry/react-nativeexpects. The warning is visible whendebug: trueis enabled.Changes:
EXPECTED_ANDROID_SDK_VERSIONconstant toRNSentryVersion.javaio.sentry.android.core.BuildConfig.VERSION_NAMEinupdateWithReactFinals(runs after user configuration, so the debug logger is available)scripts/update-android.shto bump the new constant alongside other version references💡 Motivation and Context
Closes #3671
When
@sentry/react-nativeis combined with the Sentry Android Gradle Plugin (SAGP), Gradle dependency resolution can pick a newersentry-androidversion than the RN SDK expects. This version mismatch causesIllegalStateExceptioncrashes at app startup. This change warns users at runtime so they can fix the issue before it escalates.💚 How did you test it?
scripts/update-android.sh set-versionupdatesRNSentryVersion.javaalongsidebuild.gradle,expo-handler/build.gradle, andreplay-stubs📝 Checklist
sendDefaultPIIis enabled🔮 Next steps