Repository navigation
fix(proguard): Unwrap analytics variant for optimization - #1382
Merged
Merged
Conversation
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
romtsn
marked this pull request as ready for review
August 11, 2026 11:32
romtsn
requested review from
0xadam-brown,
adinauer,
markushi,
romtsn and
runningcode
as code owners
August 11, 2026 11:32
runningcode
approved these changes
Aug 11, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the quick fix!
Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Temporarily skip analytics unwrap so CI can prove the TestKit fixture with enableProfileJson fails without the production fix. Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
TestKit with enableProfileJson failed on AGP 9.3+ without unwrap, matching the customer AnalyticsEnabledApplicationVariant path. Restore the fix.
romtsn
reviewed
Aug 11, 2026
romtsn
reviewed
Aug 11, 2026
Log when getDelegate unwrap fails so incomplete internal variant access is visible, and assert assemble/install/debuggable behavior under the forced-analytics TestKit fixture. Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
Use withArguments per scenario so runner args do not accumulate, and assert installRelease dry-run pulls in native-symbol upload via installProvider wiring.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 444edbf. Configure here.
AGP only registers install* for signing-ready variants. Point release at the debug signingConfig so the analytics installProvider assertion can run.
trimIndent left applyUploadNativeSymbols ending on `}` with no newline.
Appending android { glued to `}android {`, so Groovy treated it as
sentry.android and failed the new analytics installProvider TestKit test.
Drop the settings.gradle.kts blank-line hunk now that main has #1388. Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>
3 tasks
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.

Summary
android.enableProfileJson=trueunwrapImpl()also coversisDebuggable,assembleProvider, andinstallProviderAGP 9.3 can wrap the public variant in
AnalyticsEnabledApplicationVariant. The wrapper does not exposegetOptimizationCreationConfig, so mapping tasks were skipped when onlyoptimization.enableenabled R8.This is a bug in the 6.18.0 AGP 9.3 support path, not missing AGP 9.3.1 support.
Mutation proof
Without the unwrap, AGP 9.3+ TestKit failed with the same customer stack when analytics wrappers were forced via
android.enableProfileJson=true:AnalyticsEnabledApplicationVariant_Decorated.getOptimizationCreationConfig()SentryPluginTest > creates proguard mapping tasks when app optimization is enabled(AssertionErrorat the unwrap-warning assert)Earlier sample-path mutation (before switching coverage to TestKit):
The unwrap is restored on top of the forced-analytics TestKit coverage.
Testing
git diff --checkRequested by Roman Zavarnitsyn.
--
View Junior Session [Sentry]