Skip to content

fix: Source context for class libraries when running on Android in Release mode #4294

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

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

jamescrosswell
Copy link
Collaborator

explorerAssembly = new(explorer, assembly);
return true;
}
}
_logger?.Invoke("No best assembly for {0} in APK AssemblyStore", name);
Copy link
Member

Choose a reason for hiding this comment

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

looks like we have one logger but shouldn't this be a level Error log?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'd have to refactor the AssemblyReader classes that we vendored in fomr MS in order to be able to do that (they use a different pattern for logging).

Probably the easiest would be to replace DebugLogger with our own IDiagnosticLogger... would involve quite a few changes, but then we've made so many changes to these already that the only way to merge in changes from new code is by hand. So a few more changes wouldn't hurt.

@jamescrosswell
Copy link
Collaborator Author

jamescrosswell commented Jul 15, 2025

Note

This behaviour only manifests in CI (with the headless runners). Device tests work fine when run locally on a simulator.

Something very unusual happening with the device tests. Running against API levels 27 and 33, 27 always fails. 33 fails frequently (but not always).

Since Google require folks target 34 and higher to be able to release anything on the play store now, I figured I'd bump the API levels we test against to 34 (oldest supported) and 36 (latest). The also both seem to fail.

Looking at the logs, there don't appear to be any failed tests.

In one run, I noticed the last line that gets logged from .NET SDK is:

07-14 05:34:09.084  4252  4294 I DOTNET  : 	[IGNORED] Sentry.Maui.Tests.SentryMauiScreenshotTests.CaptureException_BeforeCaptureScreenshot_DefaultAsync

Shortly after that I see some logs from sentry-native:

07-14 05:34:10.213  4252  5450 I sentry-native: entering signal handler
07-14 05:34:10.225  4252  4280 I sentry-native: entering signal handler
07-14 05:34:10.229  4252  5450 D sentry-native: captured backtrace from ucontext with 1 frames
07-14 05:34:10.232  4252  5450 D sentry-native: captured backtrace with 1 frames
07-14 05:34:10.232  4252  5450 D sentry-native: merging scope into event
07-14 05:34:10.232  4252  5450 D sentry-native: trying to read modules from /proc/self/maps
...
07-14 05:34:11.726  4252  5439 I sentry-native: entering signal handler
...
07-14 05:34:11.828  4252  5450 D sentry-native: read 475 modules from /proc/self/maps
07-14 05:34:11.828  4252  5450 D sentry-native: adding attachments to envelope
07-14 05:34:11.828  4252  5450 D sentry-native: sending envelope
07-14 05:34:11.829  4252  5450 I sentry-native: crash has been captured

So it looks like potentially there is a low level crash that sentry-native is picking up and sending as an envelope. To where though and from which test?

Even then, this was only on the Run against API level 34... level 36 doesn't show any native errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partial source context in Release with multi-project MAUI apps
2 participants