-
-
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
.NET 6 iOS support #1282
Comments
@lucas-zimerman Hey, any news on it? |
Currently, it's on hold but we'll return to it near to MAUI release date. |
@gsomix anything specific you're looking for? The SDK should work on iOS, just not capturing native crashes |
This is the main problem. Native crashes are also very useful information. Many native crashes can be caused by managed code. It would also be important to have information about the platform, device model, os version, cpu model, etc. This is important especially on Android. |
I also want to draw attention to an exception in the getsentry/sentry-xamarin#97 This exception is thrown inside sentry-dotnet: I don't know how this used to work, but the Xamarin.iOS implementation of HttpClient does not have an implementation for SupportsAutomaticDecompression: I checked our project (old Xamarin.iOS) and it uses
But it stopped working after porting the project to .Net 6 (getsentry/sentry-xamarin#97) The recommended handler is NSUrlSessionHandler. You can read more about HTTP stack on iOS: So it seems that the problem is really in sentry-dotnet. |
It seems the problem is really in .NET 6 in this case. In the iOS implementation, that's throwing:
Perhaps disabling compression on the client could be a work around |
The Sentry.Xamarin package relies on Xamarin.Essentials which is now part of .NET MAUI. So we could add the device information bits for MAUI (on a That said improving support (including a work around so that it doesn't throw when using a net6 iOS build) is needed here and we'd love to get come contributions |
We're going to tackle this soon |
I started playing with this, and and found a few things:
Hopefully we can work through some of this by leveraging our native SDK. |
Thanks for sharing these findings.
Mono is the runtime for mobile in .NET 6 👍
On iOS, you can't debug through a signal handler, so crash reporting is hard to debug. We test the iOS native SDK for hard crashes only without a debugger attached. Could it be related? Seems not to be the case now that I followed the issue you raised with .NET folks Binding docs seem to still be under Xamarin only: https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/binding/objective-c-libraries?tabs=macos @filipnavara shared a link to some tests folks do on bindings that can help us out: https://github.com/xamarin/xamarin-macios/tree/f1e4cbcfcdd887819b493460441da187e0e2f11b/tests/bindings-xcframework-test/dotnet A few findings from the macios tests that are not on the docs: Relevant properties:
Binding static lib
framework and xcframework:
|
For reference: xamarin/xamarin-macios#15252 And I've applied that workaround here: sentry-dotnet/src/Sentry.Maui/Internal/SentryMauiInitializer.cs Lines 34 to 40 in ebe29ef
It's in |
Completed in #1829 |
Since .NET 6 landed (#939 ) we can look into adding
net6-ios
and including sentry-cocoa.See: https://github.com/xamarin/xamarin-macios/blob/861c40dbe45478b848ac1d165314e05de012bf0f/tests/dotnet/NativeXCFrameworkReferencesApp/shared.csproj
When we bundle the Sentry iOS SDK we need to take into account that Mono uses some signals to interpret
NullReferenceException
s and need special case (run before other crash reports do):See: https://www.mono-project.com/docs/advanced/signals/#incomplete-solution
See also: dotnet/runtime#44736
This is probably something we can do in the binding project, before calling
Init
in the iOS SDK.Proposed solution, based on the Mono docs:
See: https://www.mono-project.com/docs/advanced/signals/#complete-solution
The text was updated successfully, but these errors were encountered: