Skip to content

ref(proguard): Detect mappings from produced artifacts - #1377

Open
sentry-junior[bot] wants to merge 11 commits into
fix/agp-93-optimization-mappingsfrom
refactor/proguard-mapping-artifact-detection
Open

ref(proguard): Detect mappings from produced artifacts#1377
sentry-junior[bot] wants to merge 11 commits into
fix/agp-93-optimization-mappingsfrom
refactor/proguard-mapping-artifact-detection

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Detect ProGuard/R8 mapping availability from the produced mapping artifact instead of AGP minification flags. This removes the AGP 9.3 internal reflection boundary and should naturally support future optimization DSL changes.

Lazy mapping tasks

Mapping UUID and upload tasks are registered whenever mapping support is enabled, then skipped when no mapping file exists. Non-minified builds keep producing no UUID and no upload, while optimized builds use the existing artifact wiring.

Compatibility

The existing AGP 8.3+ toListenTo path and pre-8.3/DexGuard task wiring remain intact. The branch is based on #1376 so the design can be reviewed independently before deciding whether to replace that targeted fix.

Compilation succeeded. Targeted tests reached test compilation but the sandbox Gradle daemon was killed before execution; the Android integration test could not run because the sandbox has no Android SDK.

#skip-changelog

Requested by Roman Zavarnitsyn.

--

View Junior Session Sentry

@romtsn romtsn added the sanity-check PR needs a lightweight review for obvious issues label Jul 31, 2026
@romtsn
romtsn marked this pull request as ready for review July 31, 2026 11:24

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0379c48. Configure here.

Co-Authored-By: Roman Zavarnitsyn <roman.zavarnitsyn@sentry.io>

@0xadam-brown 0xadam-brown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few quick comments; otherwise lgtm (and also prefer this route to #1376) 👍

try {
mappingFile.orNull?.asFile?.takeIf { it.exists() }
?: fallbackMappingFiles.files.firstOrNull { it.exists() }
} catch (_: GradleException) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we narrow these to the known “provider has no value” / missing-artifact cases (and rethrow anything else)? Worried we might suppress exceptions we shouldn't....

@@ -374,9 +374,10 @@ class SentryPluginTest :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like we should also update creates proguard mapping tasks when app optimization is enabled() above. (It's still limited to --dry-run task-name presence, so presumably will pass even if execution-time detection never consumes a produced mapping.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants