-
Notifications
You must be signed in to change notification settings - Fork 126
ANDROAPP-7426-Upload-proguard-mapping-on-Sentry #4569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR integrates the Sentry Gradle SDK to enable automatic uploading of ProGuard mapping files for production release builds to Sentry. This will improve crash report debugging by allowing deobfuscation of stack traces from minified release builds.
Key Changes:
- Updated Sentry library from 8.23.0 to 8.29.0 and added Sentry Gradle plugin (5.12.2)
- Configured Sentry plugin in app/build.gradle.kts with ProGuard mapping upload, source context, and disabled native symbols
- Added SENTRY_AUTH_TOKEN to CI/CD workflows for authenticated uploads to Sentry
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| gradle/libs.versions.toml | Updated Sentry library version to 8.29.0 and added Sentry Gradle plugin version 5.12.2 with corresponding alias |
| app/build.gradle.kts | Applied Sentry Gradle plugin and configured it to upload ProGuard mappings and source context to Sentry project |
| .github/workflows/deploy-release.yml | Added SENTRY_AUTH_TOKEN environment variable for both release and training APK builds |
| .github/workflows/build-release-candidate.yml | Added SENTRY_AUTH_TOKEN environment variable for both release candidate and training builds |
| //Upload the mapping on every release build | ||
| autoUploadProguardMapping.set(true) |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The autoUploadProguardMapping is set to true, which will attempt to upload ProGuard mapping files on every release build, including local developer builds. This could cause build failures for developers who don't have the SENTRY_AUTH_TOKEN environment variable set, or unnecessary uploads during development.
Consider setting this to false and relying on CI/CD to upload mappings only when needed, or make it conditional based on the presence of the auth token.
| //Upload the mapping on every release build | |
| autoUploadProguardMapping.set(true) | |
| // Upload the mapping on release builds only when an auth token is present (e.g. in CI) | |
| val hasSentryAuthToken = System.getenv("SENTRY_AUTH_TOKEN")?.isNotBlank() == true | |
| autoUploadProguardMapping.set(hasSentryAuthToken) |
| authToken.set(System.getenv("SENTRY_AUTH_TOKEN")) | ||
|
|
||
| // Enable ProGuard/R8 mapping upload for deobfuscation, maps are available in the build folder | ||
| includeProguardMapping.set(true) | ||
| //Upload the mapping on every release build | ||
| autoUploadProguardMapping.set(true) | ||
|
|
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The authToken is obtained directly from the environment variable without a fallback or default value. If SENTRY_AUTH_TOKEN is not set (e.g., during local development or in certain build configurations), this could cause issues with the Sentry plugin configuration.
Consider providing a default empty string or making the upload conditional on the presence of the token to allow builds to succeed locally without the token.
| authToken.set(System.getenv("SENTRY_AUTH_TOKEN")) | |
| // Enable ProGuard/R8 mapping upload for deobfuscation, maps are available in the build folder | |
| includeProguardMapping.set(true) | |
| //Upload the mapping on every release build | |
| autoUploadProguardMapping.set(true) | |
| val sentryAuthToken = System.getenv("SENTRY_AUTH_TOKEN") | |
| if (!sentryAuthToken.isNullOrBlank()) { | |
| authToken.set(sentryAuthToken) | |
| // Enable ProGuard/R8 mapping upload for deobfuscation, maps are available in the build folder | |
| includeProguardMapping.set(true) | |
| // Upload the mapping on every release build | |
| autoUploadProguardMapping.set(true) | |
| } else { | |
| // When no auth token is available (e.g., local development), disable uploads | |
| includeProguardMapping.set(false) | |
| autoUploadProguardMapping.set(false) | |
| } |



Description
Link the JIRA issue.
Install Sentry Gradle SDK to upload proguard map in production releases