Using multiple crash reporting SDKs simultaneously with MvvmCross can be complex and may not always be recommended, especially on iOS. Here's a detailed overview:
General Considerations
1. iOS Limitations: On iOS, using multiple crash reporting SDKs is generally not recommended. This is because iOS handles exceptions and signals in a way that doesn't guarantee all crash reporters will catch all exceptions and signals, potentially leading to missed crashes[8]. However, some developers have successfully used multiple crash reporters like TestFlight and Crashlytics together, but this requires careful setup[4].
2. Android Flexibility: On Android, it is more feasible to use multiple crash reporting SDKs simultaneously. However, it's crucial to ensure that each SDK is initialized in the correct order to avoid conflicts. For example, Instabug should be initialized after other crash reporters[8].
MvvmCross Integration
When integrating crash reporting SDKs with MvvmCross, you need to consider how each SDK handles uncaught exceptions and how they interact with the MvvmCross framework.
- Exception Handling: MvvmCross itself does not provide built-in crash reporting. You will need to integrate a third-party SDK. When using multiple SDKs, ensure that they are configured to handle exceptions correctly without interfering with each other.
- Core Project Setup: In your MvvmCross Core project, you typically won't handle crash reporting directly. Instead, you'll integrate crash reporting in the platform-specific projects (e.g., iOS and Android). However, you might want to centralize error handling logic in the Core project for consistency across platforms.
Crash Reporting SDK Options
Several crash reporting SDKs can be used with MvvmCross:
- App Center: Provides comprehensive crash reporting and analytics for both iOS and Android. It's easy to integrate with Xamarin and MvvmCross projects[5].
- New Relic: Offers robust crash reporting and performance monitoring. It supports Android and can work alongside other crash reporting frameworks[2][10].
- Instabug: Provides detailed crash reports and user feedback tools. It can be used on both iOS and Android, but with the noted limitations on iOS[8].
Implementation Steps
To implement multiple crash reporting SDKs with MvvmCross:
1. Choose SDKs: Select the SDKs you want to use based on your platform and feature requirements.
2. Initialize SDKs: Ensure each SDK is initialized correctly in the platform-specific projects. On Android, initialize them in the correct order to avoid conflicts.
3. Handle Exceptions: Configure each SDK to handle uncaught exceptions. If using multiple SDKs, ensure they are set up to work together without interfering with each other's exception handling.
4. Test Thoroughly: Test your app thoroughly to ensure that all crash reporting SDKs are working as expected and not causing any conflicts.
In summary, while it's technically possible to use multiple crash reporting SDKs with MvvmCross, it requires careful setup and testing, especially on iOS. On Android, it's more straightforward but still requires attention to initialization order.
Citations:[1] https://stackoverflow.com/questions/19464339/xamarin-mvvmcross-and-crashreporting
[2] https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/android-agent-crash-reporting/
[3] https://www.mvvmcross.com/documentation/advanced/mvxnotifytask
[4] https://stackoverflow.com/questions/10755278/use-multiple-crash-reporter-on-ios
[5] https://www.youtube.com/watch?v=jr2Fe-Wan9c
[6] https://stackoverflow.com/questions/59078153/mvvmcross-android-10-0-q-mainactivity-exception-crash-on-setcontentview/59558389
[7] https://github.com/MvvmCross/MvvmCross/issues/4295
[8] https://help.instabug.com/en/articles/2102240-can-i-use-the-instabug-crash-reporting-tool-in-parallel-with-other-crash-reporters
[9] https://www.appdome.com/how-to/mobile-app-security/mobile-data-encryption/appdome-integrates-crash-reporting-sdk/
[10] https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-android/install-configure/android-agent-native-crash-reporting/
[11] https://support.google.com/googleplay/android-developer/answer/12246095?hl=en
[12] https://learn.microsoft.com/en-us/appcenter/sdk/crashes/android
[13] https://learn.microsoft.com/en-us/appcenter/sdk/troubleshooting/xamarin
[14] https://www.guardsquare.com/blog/making-the-most-out-of-ios-crash-reports-with-lldb