-
-
Notifications
You must be signed in to change notification settings - Fork 213
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initializing SentrySdk Crashes when running with AndroidEnableAssemblyCompression = false in Release mode #3920
Comments
Hey @Cheesebaron, Thanks for raising an issue. I'd avoid setting The original problem you're seeing appears to be coming from here:
Seemingly that
The good news is that I can reproduce with the sample app you provided! And I've found a couple of clues on stack overflow so it should be possible to find a way to work around this. |
I am not even sure why it is only an issue when AndroidEnableAssemblyCompression in csproj is to false. Almost inclined to say it is an issue in the .NET workload. The Global Mode seems to be a misunderstanding from my colleague when setting up Sentry in that App, will let them know 🤔 |
Interestingly, I don't get the problem with the following changes: - var options = new SentryLoggingOptions
+ var options = new SentryOptions
{
- Dsn = "https://[email protected]/5428537",
+ Dsn = "https://[email protected]/5428537"
- MinimumEventLevel = LogLevel.Critical
};
SentrySdk.Init(options); This is odd since the @Cheesebaron is there a reason why you're using |
Sure, in this sample it probably doesn't make sense. The code was extracted from an App where we also call |
I have the same issue as Cheesebaron. Had originally With Options:
It's not the same Exception msg, similar though
|
This issue is very much in the dotnet internals. I've tried various workarounds without success so far. An issue has been filed with the dotnet android team here: dotnet/android#9752 |
Package
Sentry.Extensions.Logging
.NET Flavor
.NET
.NET Version
9.0.100
OS
Android
SDK Version
5.0.0 + 5.0.1
Self-Hosted Sentry Version
No response
Steps to Reproduce
We have an application which only exposes a Service. This is normally bound to by some of our other applications to exchange information.
We upgraded to .NET 9 and Sentry to 5.0.1 recently, and we see a weird crash when the Service starts, we initially thought it was some of our dependencies that were causing the issue, but seems like even when moving the initialization code to MainApplication it throws the following exception at startup:
This is when we call the following code in
MainApplication.OnCreate
:Interestingly we had the
IsGlobalModeEnabled
=false
set in options then it seemd to crash differently at startup with:I've managed to narrow this down to the project property
AndroidEnableAssemblyCompression
which we had set tofalse
. If I recall correctly, we set this to work around an issue in an earlier version of the .NET Android workloads that would crash the App at startup trying to unpack the assemblies.My question is, why does this cause Sentry to crash at startup when this property is set to false. Seemingly it mainly happens in Sentry code, because when we remove SentrySdk.Init the rest of the App seems to work OK.
Here is a repo with the issue: https://github.com/Cheesebaron/SentryInitCrash build it in Release mode and deploy to an emulator/device and start the main activity. It will crash on startup with a similar error as above.
Expected Result
SentrySdk.Init should with with
AndroidEnableAssemblyCompression
=false
?Actual Result
See exceptions above.
The text was updated successfully, but these errors were encountered: