Description
Package
Sentry
.NET Flavor
.NET
.NET Version
9.0
OS
Android
SDK Version
4.13.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
- Create .Net MAUI application in Visual Studio.
- Install Sentry.Maui from Nuget and setup.
- Build a Release version of the Android app and install on mobile phone.
- The app will crash within first 30 seconds of startup.
Expected Result
App should not crash.
Actual Result
As per Keren from Sentry's request I've created this issue, he's my original support message:
I'm using Sentry with .Net Maui, and I think I may have discovered a bug.
We've been receiving SEGFAULT runtime errors - apps crashing after maybe 20 seconds of startup, triggered by NETWORK_CAPABILITIES_CHANGED and BATTERY_CHANGED events. This problem has been reported by someone else to the Maui team via Github, and I've been helping to investigate the issue dotnet/maui#25446
I've discovered that the common denominator with all users having these problems is that they're using Sentry.Maui
When we remove Sentry from our builds the crashes stop. When we add Sentry back in, and remove AOT and trimming, the crashes stop. It looks like the Maui compilation linker is trimming certain methods from the Sentry plugin, which is causing the crashes, as these methods are clearly being called somewhere, possibly being called via Reflection or the like.
Perhaps it's possible to have Sentry's classes marked with directives to prevent trimming, so that they're preserved in-full during compilation?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status