From 6fb08f79e923cb1ebaf0468b4d0cc54563af718a Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 17 Apr 2026 13:39:19 +0200 Subject: [PATCH] ci(danger): Demote Android SDK version mismatch check from fail to warn The check was introduced to prevent shipping a sentry-android version that differs from the one bundled by our pinned Sentry Android Gradle Plugin, since a mismatch causes an IllegalStateException crash when AGP autoInstallation is enabled. Following the documentation update in getsentry/sentry-docs#17349, React Native users are now explicitly told to set autoInstallation.enabled = false. Per internal discussion, users who opt into AGP are expected to follow the setup guide, so the footgun is no longer silent, and hard-failing the check unnecessarily couples RN SDK release cadence to gradle plugin release cadence. Downgrade to warn() so reviewers still see the mismatch, with an updated message pointing to the docs-based mitigation. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/check-android-sdk-mismatch.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/check-android-sdk-mismatch.js b/scripts/check-android-sdk-mismatch.js index 5c5bba7752..50e6bf14f5 100644 --- a/scripts/check-android-sdk-mismatch.js +++ b/scripts/check-android-sdk-mismatch.js @@ -119,17 +119,20 @@ module.exports = async function ({ fail, warn, __, ___, danger }) { // Compare versions if (sdkVersion !== bundledVersion) { - fail( + warn( createSectionWarning( 'Android SDK Version Mismatch', `| Component | Version |\n` + `|-----------|--------|\n` + `| \`sentry-android\` in build.gradle | **${sdkVersion}** |\n` + `| \`sentry-android\` bundled by gradle plugin ${gradlePluginVersion} | **${bundledVersion}** |\n\n` + - `This mismatch will cause crashes on Android with error:\n` + + `If a user enables AGP \`autoInstallation\` (default: \`true\`), this mismatch causes:\n` + `> \`IllegalStateException: Sentry SDK has detected a mix of versions\`\n\n` + - `**Fix:** Update \`packages/core/android/build.gradle\` to use version \`${bundledVersion}\` ` + - `or wait for a gradle plugin release that bundles \`${sdkVersion}\`.`, + `Our docs instruct React Native users to set \`autoInstallation.enabled = false\`, ` + + `so users following the guide are unaffected. Consider either updating ` + + `\`packages/core/android/build.gradle\` to \`${bundledVersion}\` or waiting for a ` + + `gradle plugin release that bundles \`${sdkVersion}\`.`, + '⚠️', ), ); } else {