Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Generate and inject uuid to apk and upload proguard with that uuid#4532

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@alexsohn1126
Copy link
Member

fixes#3872

Problem

We were not automatically injecting uuid to the MAUI Android apk, so developers would have to manually go in and editAndroidManifest.xml.

Solution

As proposed by@rafalka, we can inject the uuid to the Apk, and upload the proguard file with the same uuid.

Before

Before the fix, running in the MAUI project would upload the proguard file with the uuid, but it won't inject the uuid to the Android app.

After

We should now see the proguard file in Sentry with some uuid:

image

If we open the resulting APK in Android studio to inspect it'sAndroidManifest.xml, we can see that it correctly set themeta-data field:

image

Testing method

To test this change using oursamples/Sentry.Samples.Maui, we need to modifysrc/Sentry/buildTransitive/Sentry.targets file. If not using our sample MAUI project, ignore this step.

We have to remove the check whether this is a Sentry project or not. So delete theand [...] in line 72-73:

<UseSentryCLICondition="
'$(UseSentryCLI)' == ''
and ('$(SentryUploadSymbols)' == 'true' or '$(SentryUploadSources)' == 'true' or $(SentryUploadAndroidProguardMapping) == 'true' or $(SentryCreateRelease) == 'true' or $(SentrySetCommits) == 'true')
and '$(MSBuildProjectName)' != 'Sentry'
and !$(MSBuildProjectName.StartsWith('Sentry.'))">true</UseSentryCLI>

Next, ensureSentryUploadAndroidProguardMapping is set to true in your MAUI project's .csproj file:

    <SentryUploadAndroidProguardMapping>true</SentryUploadAndroidProguardMapping>

In the same file, enable Proguard. This is what I used:

  <PropertyGroup Condition="'$(Configuration)' == 'Release'">    <AndroidLinkTool>r8</AndroidLinkTool>    <AndroidLinkMode>Full</AndroidLinkMode>    <AndroidEnableProguard>true</AndroidEnableProguard>  </PropertyGroup>

Rundotnet publish -f net9.0-android35.0 -c Release in the MAUI project root.

seer-by-sentry[bot] reacted with hooray emoji
@codecov
Copy link

codecovbot commentedSep 16, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.36%. Comparing base (58b5da0) to head (30e19d4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #4532      +/-   ##==========================================- Coverage   73.37%   73.36%   -0.02%==========================================  Files         479      479                Lines       17505    17505                Branches     3445     3445              ==========================================- Hits        12844    12842       -2- Misses       3783     3784       +1- Partials      878      879       +1

☔ 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
Copy link
MemberAuthor

alexsohn1126 commentedSep 17, 2025
edited
Loading

Looks like there is an endpoint for proguard artifact upload that is not implemented in sentry-cli integration tests server.

In other integration test servers, they have endpoints forproguard-artifact-releases:

I'll make a PR over atsentry-cli tomorrow for this, or should I ask someone else?

Doesn't seem too hard to make it, what can possibly go wrong 🫨

@alexsohn1126
Copy link
MemberAuthor

Actually, it's kind of weird that we are getting errors from uploading proguards now but we weren't before?

Maybe something's up with my implementation, but from what I can see, it doesn't touch the condition which the proguard file is sent so...

@alexsohn1126
Copy link
MemberAuthor

Blocked bygetsentry/github-workflow #100

alexsohn1126and others added3 commitsSeptember 19, 2025 11:24
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Copy link
Collaborator

@jamescrosswelljamescrosswell left a comment

Choose a reason for hiding this comment

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

Looks good - thanks@alexsohn1126 !

alexsohn1126 reacted with heart emoji
This was referencedOct 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jamescrosswelljamescrosswelljamescrosswell approved these changes

@Flash0verFlash0verFlash0ver approved these changes

@bruno-garciabruno-garciaAwaiting requested review from bruno-garcia

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Adding support for generating or passing UUID when uploading proguard mapping on .NET MAUI

7 participants

@alexsohn1126@jamescrosswell@bruno-garcia@Flash0ver@jpnurmi@getsentry-bot

[8]ページ先頭

©2009-2025 Movatter.jp