fix(bugsnag): give the app and the uploaded mapping the same build UUID - #1374
Merged
Conversation
Bugsnag joins an uploaded ProGuard mapping to an incoming event on build UUID,
falling back to applicationId + versionName + versionCode. Neither side was
supplying one, so matching rested entirely on the version numbers.
The app never reported a build UUID. com.bugsnag.gradle 1.2.0 emits it as a
string resource, but bugsnag-android 6.27 reads com.bugsnag.android.BUILD_UUID
only as manifest meta-data (ManifestConfigLoader) — nothing in the AAR looks the
resource up. Being unreferenced, the resource is then dropped by resource
shrinking, per mapping/release/resources.txt:
string:com_bugsnag_android_BUILD_UUID:2131820793 is not reachable.
The upload omitted it as well: registerProguardMappingTask sets build-uuid only
when the bugsnag DSL supplies buildUuid or buildUuidGenerator, and this project
supplied neither.
Use the commit SHA for both. The release workflow builds the bundle and runs
bugsnagUploadReleaseProguardMapping in the same job on the same checkout, so the
two Gradle invocations resolve the same HEAD. Carrying the app's copy as manifest
meta-data rather than a resource also keeps it out of the shrinker's reach.
bmc08gt
added a commit
that referenced
this pull request
Aug 31, 2026
The release deploy has failed since #1374 with `unknown flag --build-uuid` from `bugsnagCreateReleaseBuild`. bugsnag-gradle-plugin 1.2.0 hands the variant's `buildUuid` to two CLI calls: `upload android-proguard`, which accepts `--build-uuid`, and `create-build`, which does not — the flag is absent from the 3.10.2 the plugin embeds and from 3.10.5, the current release. PR CI never caught it because only the deploy workflow runs the Bugsnag tasks. Set the UUID on the mapping upload task instead of through the `bugsnag` block, so create-build goes back to its working default. The plugin only writes that property when the DSL supplies a value, so it cannot overwrite this one regardless of which configuration action runs first. Verified against a stand-in CLI that records its arguments: create-build now passes no `--build-uuid` and keeps the rest of its flags, the mapping upload passes `--build-uuid=<HEAD>`, and the merged release manifest carries the same SHA in `com.bugsnag.android.BUILD_UUID`.
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.
Release crashes come through obfuscated. Bugsnag joins an uploaded ProGuard mapping to an incoming event on build UUID, falling back to applicationId + versionName + versionCode — and neither side of this build was supplying a build UUID, so matching rested entirely on the version numbers.
The app never reported one
com.bugsnag.gradle1.2.0 emits the UUID as a string resource (GenerateResourcesTask), butbugsnag-android6.27 readscom.bugsnag.android.BUILD_UUIDonly as manifest meta-data —ManifestConfigLoaderlists it among the meta-data keys, and no class in the AAR looks up a string resource by that name (itsR.txthas no bugsnag entry). The merged release manifest carried exactly one bugsnag meta-data entry,API_KEY.Nothing references the resource, so it does not reach the APK either. From
mapping/release/resources.txt:aapt2 dump resourceson the release APK finds no bugsnag entry.The upload omitted it too
registerProguardMappingTasksets the field conditionally:buildUuidResolver.value?.let { task.buildUuid.set(it) }BuildUuidResolver.valueresolves tobuildUuidGeneratororbuildUuidfrom thebugsnagDSL, per variant then global. This project set none of them, soUploadMappingTasksent nobuild-uuid.Change
Use the commit SHA on both sides:
buildUuidon the release variant in thebugsnagblock, so the mapping upload is tagged;com.bugsnag.android.BUILD_UUIDmanifest meta-data entry backed by amanifestPlaceholdersvalue, so the app reports the same string. Manifest meta-data is also out of the resource shrinker's reach, which the generated resource was not.The release workflow builds the bundle and runs
bugsnagUploadReleaseProguardMappingin one job on one checkout, so both Gradle invocations resolve the same HEAD.Why it matters now
versionCodewas the sole remaining join key, and the AGP 9 migration (c9edfc7) changed how it is produced:de.nanogiants.android-versioningwas Gradle 9 incompatible, soversioning.getVersionCode()becamegit rev-list --count HEAD. Within a single CI job the two invocations agree, but a value derived from commit count is easy to desynchronise and fails silently when it does. An explicit build UUID removes the dependency.Worth reporting the resource-versus-meta-data mismatch upstream as well:
com.bugsnag.gradle1.2.0 generates a resource that its own runtime never reads.