[PR #2878] [PM-4914] Sentry MAUI for crash reporting #3859

Closed
opened 2025-11-26 23:37:58 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2878

State: closed
Merged: No


Adds Sentry.Maui, initializes with the app. And configures msbuild to upload symbols automatically.

Before merging we'd need to change csproj props to take a different Sentry account (not my test one).

Added some sample buttons to make different crashes. We can remove them before merging. Or hide them somehow to be able to test things out easily.

Version is a beta right now, but the team is working on a final release soon (weeks away).

Android

A managed C# exception, with source context:

image

Note that Sentry does give you line numbers for Android crashes in Release builds published on the stores.

This is a crash done from C (P/Invoked):

image

Notice there's actually no line number. That's because the native library that crashed didn't get uploaded, this was fixed today and will be out on the next release of the SDK:

Some of the Android context:
image

iOS

Example iOS Simulator managed crash:

image
image
image
image

I'm getting an issue with the simulator though we need to look at.

Debug files

Sentry supports Portable PDB (.NET) but also DWARF, ELF, ProGuard, etc. It gets uploaded with the MSBuild. You'll see it in the logs.

 Preparing upload to Sentry for project 'App' (Debug/net8.0-ios): collecting debug symbols from bin/Debug/net8.0-ios/iossimulator-arm64/
  > Found 98 debug information files (30 with embedded sources)
  > Prepared debug information files for upload
  > Nothing to upload, all files are on the server

This log was on a second build without code changes but shows on the terminal during dotnet build
And you can see it in Sentry too:

image

Other features

We can get performance monitoring going but there's that creates transactions automatically yet so would need a bit of code. It's in the plan though.

It does pass a trace-id to the backend so you can link errors that happen on your app with anything on the backend. Super useful for debugging stuff.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/2878 **State:** closed **Merged:** No --- Adds `Sentry.Maui`, initializes with the app. And configures msbuild to upload symbols automatically. Before merging we'd need to change csproj props to take a different Sentry account (not my test one). Added some sample buttons to make different crashes. We can remove them before merging. Or hide them somehow to be able to test things out easily. Version is a beta right now, but the team is working on a final release soon (weeks away). ## Android A managed C# exception, with source context: ![image](https://github.com/bitwarden/mobile/assets/1633368/f2d2239e-0d42-4718-b19e-9547d507d15d) Note that Sentry **does** give you line numbers for Android crashes in Release builds published on the stores. This is a crash done from `C` (P/Invoked): ![image](https://github.com/bitwarden/mobile/assets/1633368/f543c6b9-848c-40ea-9ba9-bae0f36252bc) Notice there's actually no line number. That's because the native library that crashed didn't get uploaded, this was fixed today and will be out on the next release of the SDK: * https://github.com/getsentry/sentry-dotnet/pull/2876 Some of the Android context: ![image](https://github.com/bitwarden/mobile/assets/1633368/1f72b2bf-c037-4f1c-a847-a7f1c5a382d0) ## iOS Example iOS Simulator managed crash: ![image](https://github.com/bitwarden/mobile/assets/1633368/25fddbe9-24ec-4e8d-8cfe-c44716cd9c19) ![image](https://github.com/bitwarden/mobile/assets/1633368/ecca569e-6425-4bad-8cc9-6a317b78e559) ![image](https://github.com/bitwarden/mobile/assets/1633368/5dcd8302-496c-4302-837d-f370c38718d7) ![image](https://github.com/bitwarden/mobile/assets/1633368/a949b6c1-f140-4e48-92b3-1dd238ed4942) I'm getting an issue with the simulator though we need to look at. ## Debug files Sentry supports Portable PDB (.NET) but also DWARF, ELF, ProGuard, etc. It gets uploaded with the MSBuild. You'll see it in the logs. ``` Preparing upload to Sentry for project 'App' (Debug/net8.0-ios): collecting debug symbols from bin/Debug/net8.0-ios/iossimulator-arm64/ > Found 98 debug information files (30 with embedded sources) > Prepared debug information files for upload > Nothing to upload, all files are on the server ``` This log was on a second build without code changes but shows on the terminal during `dotnet build` And you can see it in Sentry too: ![image](https://github.com/bitwarden/mobile/assets/1633368/c726b1f6-4d5e-4b88-9b53-5b31baef15fb) ## Other features We can get performance monitoring going but there's that creates transactions automatically yet so would need a bit of code. It's in the plan though. It does pass a `trace-id` to the backend so you can link errors that happen on your app with anything on the backend. Super useful for debugging stuff. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:37:58 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3859