fix: Remove BaseExtension usage for AGP 9 compatibility#1212
Merged
Conversation
Replace `BaseExtension` (removed in AGP 9) with stable APIs that work across all supported AGP versions (7.4+): - Use `ApplicationVariant.namespace` instead of `BaseExtension.namespace` - Use `CommonExtension` instead of `BaseExtension` for telemetry - Use `CommonExtension.defaultConfig.minSdk` instead of the deprecated `minSdkVersion.apiLevel` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `variant.namespace` provider may be absent on AGP 7.x, causing a `MissingValueException` at task execution time. AGP 8.0 made namespace mandatory, so add a clear check at configuration time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0xadam-brown
approved these changes
May 21, 2026
| sentryProject: String?, | ||
| ) { | ||
| check(AgpVersions.CURRENT >= AgpVersions.VERSION_8_0_0) { | ||
| "Sentry Snapshots require Android Gradle Plugin 8.0 or higher. " + |
| ### Fixes | ||
|
|
||
| - Fail fast with a clear error when Snapshots feature is used with AGP 7.x ([#1212](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1212)) | ||
|
|
Member
There was a problem hiding this comment.
l: Do we need to make this limitation explicit in any of our developer docs? (Not a blocker here, of course.)
Member
|
(Test Matrix failure is the same existing issue mentioned here. Doesn't need to hold us up.) |
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.
BaseExtensionisn't deprecated when compiling against AGP 8.X but it is suddenly removed in AGP 9.X :(See docs: https://developer.android.com/build/releases/agp-9-0-0-release-notes
This removes all usages of it.
Separately because of a subtle bug that seer pointed out, I decided that we don't support AGP 7.X with snapshots. In that case we'll throw a clear error message when snapshots are enabled. #1212 (comment)