Skip to content

Conversation

@alexsohn1126
Copy link
Member

@alexsohn1126 alexsohn1126 commented Oct 16, 2025

Fixes #4597

Problem

The setup described in #4597 is the following:

  • Project A (MAUI app)
    • references project B and C
  • Project B (Android Library)
    • Targets net9.0-android
    • references project C
  • Project C
    • a simple class library

Then the build will fail on _ManifestMerger step, due to the duplicated Android manifest metadata sentry.proguard-uuid.

This was caused by sentry.proguard-uuid being set up every time an Android project is built. So in the reproducible example above, sentry.proguard-uuid would be set in Project A and B.

Solution

I added a check to ensure sentry.proguard-uuid is set only when the property AndroidApplication is set to true, which is set to True for MAUI apps, so when MSBuild gets to project B, it doesn't generate another UUID and tries to inject it to the Android manifest.

See also:

Notes (feel free to ignore)

I have tried putting the UpdateAndroidMetadata target into a separate src/Sentry/build/Sentry.targets file (to prevent the target from running transitively), but could not get it to work.

If future problems arise where the proguard-uuid is being set multiple times, we may need to consider that as a more permanent solution

@alexsohn1126 alexsohn1126 changed the title Add AndroidApp Check for Android Metadata injection fix: Multiple sentry.proguard-uuid being set in Android manifest Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.53%. Comparing base (ad849d4) to head (489fa67).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4647      +/-   ##
==========================================
+ Coverage   73.45%   73.53%   +0.07%     
==========================================
  Files         482      483       +1     
  Lines       17678    17692      +14     
  Branches     3493     3492       -1     
==========================================
+ Hits        12986    13009      +23     
+ Misses       3801     3795       -6     
+ Partials      891      888       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexsohn1126 alexsohn1126 marked this pull request as ready for review October 16, 2025 14:10
cursor[bot]

This comment was marked as outdated.

@Flash0ver Flash0ver mentioned this pull request Oct 16, 2025
Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

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

Added one small recommendation but otherwise LGTM. 🚀

Thanks @alexsohn1126!

@alexsohn1126 alexsohn1126 merged commit 4bc0e6c into main Oct 17, 2025
33 checks passed
@alexsohn1126 alexsohn1126 deleted the alexsohn/fix/proguard-uuid-duplicate-in-android-manifest branch October 17, 2025 17:41
@bruno-garcia
Copy link
Member

@sentry review

@bruno-garcia
Copy link
Member

after that pretty bad review comment from Cursor, I'm curious what Sentry will do here

@bruno-garcia
Copy link
Member

I guess nothing because it has already been merged

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

io.sentry.proguard-uuid error during _ManifestMerger step when building MAUI app

4 participants