Closed PavelRPavlov closed 1 year ago
Just to confirm, you're asking about a traditional Xamarin Forms iOS app, and not a new net6.0-ios
, net7.0-ios
or .NET MAUI app - correct?
@mattjohnsonpint yes, that is correct. Currently we are targeting Xamarin.Forms 5.0 for all platforms, but the reported issue is only present for the iOS platform
Are you throwing an exception during the initialization from the app? One symptom could be that the SDK doesn't have enough time to flush the Cache, you can increase it by altering the InitCacheFlushTimeout:
options.InitCacheFlushTimeout = TimeSpan.FromSeconds(5);
Furthermore, could you share the SDK log by enabling the Debug parameter?
options.Debug = true;
@lucas-zimerman Thank you for the suggestions. The Debug parameter is set, as it is set in the aforementioned sample project. However, the InitCacheFlushTimeout was not, but it does not affect the behavior of the iOS app. Regarding your 1st question, I am throwing a test exception after the app is initialized. To further test if that is not an issue on my end I tried to delay the exception throwing by using a timer which was triggered after the ItemDetailPage is fully loaded. I tested delaying 1s, 5s and 10s but the results were the same - I could not see reports in the web dashboard even after restarting the app.
To speed up the testing on your side, I am sharing the project that I am testing with. You should be able to restore all nugets and build the app since this is newly created solution from the official XF template in VS. You may want to change the DSN setting in the AppDelegate.cs and to see the timing for the triggering of the exception you can inspect the ItemDetailPage.xaml.cs file xfSentryTest.zip
Hello @PavelRPavlov and thanks for your sample project!
It seems like you're facing the problem described here: https://docs.sentry.io/platforms/dotnet/guides/xamarin/troubleshooting/#eventtransaction-capture
You can fix it by following the described solution on the troubleshooting page, but in short, you need to install the package System.Memory
on a special way.
@lucas-zimerman - It would appear that the Xamarin bug that is referenced in the troubleshooting docs has been resolved.
@PavelRPavlov - Please check the Xamarin version you have installed. In Visual Studio, go to Help - About, then scroll the list of installed products to the bottom where it gives the version for Xamarin.iOS and Xamarin.Mac SDK
.
You can update it using Visual Studio Installer.
@mattjohnsonpint I checked which are the versions installed on my machine and it turned out I had all the latest.
Xamarin 17.4.0.301 (d17-4@96af3ae)
Then I tried to add the System.Memory package reference like @lucas-zimerman suggested and tried again. This time the test app that I sent was able to properly send the crash log to the Sentry dashboard.
However, the issue was not resolved yet for me because our app needs to enhance the crash report with application settings, local log and database files, user context information and more. To do all of this we are using top level try-catch for the iOS platform because the AppDoman.UnhandledException event is invoked too late and we loose the application state. In that try-catch I noticed that the exception is not rethrown. I tried to rethrow the exception and this properly triggered the SentrySdk and the enhanced message properly arrived in the dashboard.
Package
Other
.NET Flavor
Xamarin
.NET Version
.NET Standard 2.0
OS
iOS
SDK Version
1.4.4
Self-Hosted Sentry Version
No response
Steps to Reproduce
Expected Result
Either on step 7 or on step 8 the Sentry should send out the crash report
Actual Result
The crash report does not get sent even after restarting the app