-
-
Notifications
You must be signed in to change notification settings - Fork 222
MAUI Android Line Numbers & File Names Don't Appear in .NET 9 (But They Do in .NET 8) #4209
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
Comments
@jamescrosswell Thanks for the response. The steps I outlined use the sample project created by Visual Studio for .NET MAUI, but I've uploaded a copy of it for your convenience to here: https://github.com/lswdowcoombs/MauiAndroidSentryTest All you should have to do is search for Hopefully this is just a simple matter of additional configuration needed on my end, but I've combed through the sample project you mentioned and nothing has jumped out at me that I've missed... |
@lswdowcoombs the line numbers (and even source code) shows fine for me when I run your sample: About the only thing that tripped me up was that you've guarded the symbol upload so that it only occurs for release builds: When I removed that condition from the property group, the Sentry CLI was executed and debug symbols uploaded correctly on build... so that might be the issue you're running into? Basically, when you're running a build, you should see something like this when the symbol upload is working correctly:
That's the Sentry CLI being run to find and upload debug symbols so that symbolication of stack traces works as expected. |
@jamescrosswell Thanks for the response. So the reason I had that guard in place was to mimic our production application - because the whole point is to detect and log exceptions in our release builds easily across all platforms. But even with that guard removed entirely, Android Release builds never show line numbers on Sentry. Debug builds do though. In both cases, I see output from the Sentry CLI, and the fact that events are being uploaded suggests that the setup is correct. But something about being a Release build seems to prevent line numbers from appearing. Below is my output from a Release build, which seems to match yours above for the most part.
And for posterity, here is the output from a Debug build:
|
@lswdowcoombs just checking in to say that I can reproduce the issue from the sample you provided. Still trying to work out what the cause is though... |
When running Sentry.Samples.Maui in Release mode, I see this being logged to LogCat:
Which is coming from here: sentry-dotnet/src/Sentry/Internal/DebugStackTrace.cs Lines 604 to 606 in a421af5
Basically it can't resolve the DebugImage. Digging a little further in the logs I'm also seeing this:
Which is coming from the V2 Assembly Reader: sentry-dotnet/src/Sentry.Android.AssemblyReader/V2/AndroidAssemblyDirectoryReaderV2.cs Line 40 in 13d4a9f
What's curious is that we have this scenario tested here (not AOT and not using the AssemblyStore): sentry-dotnet/test/Sentry.Android.AssemblyReader.Tests/Sentry.Android.AssemblyReader.Tests.csproj Lines 34 to 35 in a9a6811
Needs further investigation. |
Thanks for the update, @jamescrosswell |
OK so I've made a bit more progress here. The APK files that we're testing against aren't the same as the APKs that get installed on a simulator/device. We adapted our In Release mode when targeting Our Assembly Reader is currently looking for modules in a To cut a long story short, in some situations we should be loading modules from the appropriate
Note that when using AssemblyStores (which is the default) the modules will not be embedded directly in the |
It looks like AndroidStudio uses something called the bundletool and this can be used to both pull out device specific APKs from an AAB file and deploy APKs to a device. The |
@lswdowcoombs after a couple of days of digging, I've finally found a fix for this. Hopefully we'll have a new release including this by late this week or early next week. |
@jamescrosswell Thank you! I appreciate your digging into this one and look forward to the fix. |
Package
Sentry.Maui
.NET Flavor
.NET
.NET Version
9.0.203
OS
Android
OS Version
Android 13
Development Environment
Visual Studio v17.x
SDK Version
5.7.0
Self-Hosted Sentry Version
No response
Workload Versions
UseSentry or SentrySdk.Init call
options.Dsn = "MY-SENTRY-DSN";
Steps to Reproduce
Sentry.Maui
version5.7.0
.UseSentry()
above to add the Dsn to startup options.MainPage.xaml.cs
and throw an exception in theOnCounterClicked()
method, for example, just so that can be logged to Sentry.Click me
button to increment the counter.Expected Result
An unhandled exception should be sent to Sentry and when viewing the details of the associated event, the stack trace should include line numbers and file names.
Actual Result
An unhandled exception is sent to Sentry, but when viewing the details of the associated event, the stack trace does not include line numbers and file names.
NOTE: If you repeat the above steps but use a project that targets .NET 8, line numbers and file names DO appear in the stack trace on Sentry.
The text was updated successfully, but these errors were encountered: