Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Is there going to be updated Firebase Crashlytics support for Xamarin.Android and Xamarin.iOS?

I have an an app that has been around for a few years in the app stores, that using the Xamarin.Android.Crashlytics nuget package. This uses bindings to the Fabric Crashlytics library, which is still working for the moment, but according to the Firebase documentation the Fabric SDK will stop working after 15th November.

They recommend moving to Firebase Crashlytics, but I can't find the Xamarin equivalent to this.

There is a Nuget package for Xamarin.Firebase.Crash, but I was under the impression this was the crash reporting from before Firebase adopted Crashlytics (the early builds are from 2017).

So the question is, what is the recommended nuget for reporting to Firebase Crashlytics on Xamarin iOS and Android upto and beyond November this year, and is there an example project/documentation for it?

Answers

  • jezhjezh Member, Xamarin Team Xamurai
    edited August 12

    From the official document Get started with Firebase Crashlytics,we will find :

    Note: The Fabric SDK is now deprecated and will continue reporting your app's crashes until November 15, 2020. On this date, the Fabric SDK and old versions of the Firebase Crashlytics SDK will stop sending crashes for your app. To continue getting crash reports in the Firebase console, make sure you upgrade to the Firebase Crashlytics SDK versions 17.0.0+ for Android, 4.0.0+ for iOS, and 6.15.0+ for Unity.

    For Upgrade to the Firebase Crashlytics SDK, you can check document: https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android

    For how to use in Xamarin, you can check article :
    Firebase Crashlytics with Xamarin .

    Besides, you can also use Appcenter to achieve this: https://appcenter.ms.

  • HenryLisowskiHenryLisowski USMember ✭✭

    So I've spent the past 2 days trying to migrate our Android app to FirebaseCrashlytics since the Fabric one finally shuts down in only 2 months, and the above response will NOT work.

    Despite seeing the Medium article linked everywhere as the "solution" to the November 15th shutdown, from all I can tell it is NOT. After spending hours trying to get the Xamarin.Android.Crashlytics package to work, I was greeted with error messages that I wasn't onboarded, and directing me to Fabric to register as an app. I looked closer at the nuget package and it is still just a wrapper around the old deprecated Fabric SDK libraries, the ones that, as mentioned, will stop working this November. There is NO reference to any Firebase libraries at all, so this is very much NOT a solution, and anyone believing it is will be sorely disappointed come November.

    I spent a while trying to find Xamarin packages that ACTUALLY wrap FirebaseCrashlytics, and have had minimal luck. There appears to be this one for ios:
    Xamarin.Firebase.iOS.Crashlytics
    but our app isn't on iOS so I can't test it.

    The results for Android seem to be worse, after a while searching the only result I found was this:
    https://www.nuget.org/packages/Xamarin.Firebase.Crashlytics/117.0.0-preview02
    Which is new as of 3 months ago, only has 2 preview releases and very little documentation, but is managed and owned by Xamarin, so it might be it?

    If the above package IS the intended Xamarin FirebaseCrashlytics wrapper, it would be extremely helpful to have that confirmed. If not could someone please point us to where it is currently, or where it will be in the future?

    As a side note, a coy response about using a similar Microsoft product to do crash reporting instead of trying to figure out why Xamarin hasn't actually supported the library developers want to use in a clear and succinct way is a tone deaf approach to this situation at best. (Pardon my French, it's been a very frustrating past several days, as it always seems to be whenever I have to spend inordinate amounts of time smashing my face into a wall trying to get Xamarin to do simple things.)

  • hello @HenryLisowski any update regarding this issue? or have you already found the solution?

  • Julien_PerezJulien_Perez Member ✭✭

    I will update this question because I struggle to find a way to implement the new version of Firebase Crashlytics.

    So I find something strange, @HenryLisowski spoke about the Xamarin.Firebase.Crashlytics nuget, but i found another one :
    https://www.nuget.org/packages/Xamarin.Firebase.Crashlytics/117.0.0-preview02
    https://www.nuget.org/packages/Xamarin.Firebase.Crash/116.2.1-preview04

    They are updated 2 mounts ago, I try to investigate on the GitHub repository, and I find a sample using the plugin Xamarin.Firebase.Crash with his version 71.1621.0.
    https://github.com/xamarin/GooglePlayServicesComponents/tree/master/samples/com.google.firebase/firebase-crash

    So right now I tried to use the Crash plugin, but there is not data reported to my Firebase Console. And I tried to implement the Crashlytics Nuget but I don't a correct way to make it works too.

    Anyone has a update about this situation?

  • ...

    They are updated 2 mounts ago, I try to investigate on the GitHub repository, and I find a sample using the plugin Xamarin.Firebase.Crash with his version 71.1621.0.

    So right now I tried to use the Crash plugin, but there is not data reported to my Firebase Console. And I tried to implement the Crashlytics Nuget but I don't a correct way to make it works too.

    Anyone has a update about this situation?

    Hi!
    Any update regarding this issue? Or have you already found the solution?

  • nmorinagnmorinag Member ✭✭

    Hello,

    Still without any updates on this issue... I'd like to think that Xamarin would put some priority over this, since we have until November 15, and there could be breaking changes that need to be addressed.

  • After trying the current nugets with a _new _app, I was seeing the prompt in the logs to register with Fabric (which of course doesn't work as it's been sunsetted). Continuing with another app I have that had Crashlytics for the last couple of years, that still works with the old libraries, and will stop mid November. Both of those aren't ideal as required to be stuck on the v60 of the other google Nugets, and there are other reasons we need to move to at least v71.

    I'd also tried some of the newer preview nugest (v117) that others have mentioned above to see if those would work but that required moving a bunch of other libraries to similar preview versions and the apps just crashed on startup without much in the way of useful information to fix it, and felt like going down an undocumented preview rabbit-hole.

    For the moment, I've had to move the Crashlytics reporting of the app back to AppCenter, so the other Google Nugets can move to v71, and we'll have crash reporting beyond November. Just wish there was some official documentation on Xamarins plans in this area, as I'd much prefer to have all the analytics and reporting in one place.

    Has anyone seen a roadmap for when the nugets are officially jumping from v71 to v117/v119?

  • For those people watching this ticket, I'd seen last week that most of the Xamarin Google nugets moved out of preview for a full 1xx version, except for Xamarin.Firebase.Crashlytics which is still on v117.0.0-preview02.

    That preview Crashlytics nuget relies on (for example) Xamarin.Firebase.Common v119.3.0-preview02 - the latest released version is v119.3.0 so I gave it a go and imported the nuget into my project. While the app built, and the APIs for (for example) Firebase.Crashlytics.FirebaseCrashlytics.Instance.RecordException are present, trying to start the app immediately crashed with reference to Dagger libaries.

    I'd also found a GitHub thread referring to the Crashlytics libraries updated 3 days ago where someone self-assigned the issue to investigate (link here: https://github.com/xamarin/GooglePlayServicesComponents/issues/384). Fingers and toes crossed...

  • RexHopeRexHope PHMember ✭✭

    @jezh said:
    From the official document Get started with Firebase Crashlytics,we will find :

    Note: The Fabric SDK is now deprecated and will continue reporting your app's crashes until November 15, 2020. On this date, the Fabric SDK and old versions of the Firebase Crashlytics SDK will stop sending crashes for your app. To continue getting crash reports in the Firebase console, make sure you upgrade to the Firebase Crashlytics SDK versions 17.0.0+ for Android, 4.0.0+ for iOS, and 6.15.0+ for Unity.

    For Upgrade to the Firebase Crashlytics SDK, you can check document: https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=android

    For how to use in Xamarin, you can check article :
    Firebase Crashlytics with Xamarin .

    Besides, you can also use Appcenter to achieve this: https://appcenter.ms.

    This doesn't help. This is our current set up and fabric will be obsolete already as per google FirebaseDoc

  • RexHopeRexHope PHMember ✭✭
    edited October 22

    @StephenClifton.9427 said:
    For those people watching this ticket, I'd seen last week that most of the Xamarin Google nugets moved out of preview for a full 1xx version, except for Xamarin.Firebase.Crashlytics which is still on v117.0.0-preview02.

    I've noticed this one also. I wonder when will they upgrade this one yet.

    That preview Crashlytics nuget relies on (for example) Xamarin.Firebase.Common v119.3.0-preview02 - the latest released version is v119.3.0 so I gave it a go and imported the nuget into my project. While the app built, and the APIs for (for example) Firebase.Crashlytics.FirebaseCrashlytics.Instance.RecordException are present, trying to start the app immediately crashed with reference to Dagger libaries.

    https://github.com/xamarin/GooglePlayServicesComponents/issues/385 have you seen this issue? and tried its fix?

    I'd also found a GitHub thread referring to the Crashlytics libraries updated 3 days ago where someone self-assigned the issue to investigate (link here: https://github.com/xamarin/GooglePlayServicesComponents/issues/384). Fingers and toes crossed...

    The searched item is not showing for the link you have provided. Any idea where did it go?

  • @RexHope Ah, looks like the Xamarin forums took the end-bracked at the end of the link as part of the link. I should have been: https://github.com/xamarin/GooglePlayServicesComponents/issues/384

    I'd not seen the issue you'd mentioned (385) but will try to follow through the steps later to see if that would work around the problem I was seeing. Thanks for flagging that one.

  • MarkRileyMarkRiley GBMember ✭✭

    Out of interest, what is the advantage of using Crashlytics over AppCenter? Presumably most custom code on a Xamarin project would be C#, so would not actually get picked up by Crashlytics, which will only report the Java stack traces?

  • RexHopeRexHope PHMember ✭✭
    edited October 23

    @MarkRiley said:
    Out of interest, what is the advantage of using Crashlytics over AppCenter? Presumably most custom code on a Xamarin project would be C#, so would not actually get picked up by Crashlytics, which will only report the Java stack traces?

    I am not sure with this as the app I am working on right now has already been built - I think they use the crashlytics with push notifications along with firebase set up, in other words, if majority of the backend works with firebase, it is best to make use of its services to connect each other, but before I joined the company I previously used appcenter for the apps my team produced. As far I am concern, it is much easier and less hassle build a set up with appcenter analytics/reports than firebase, no googleservices-json, just plain nuget and you're done (ofc including the init classes to be done). AppCenter doesn't need to be tied up to a GoogleAccount. And right now the issue is that Firebase package for xamarin android doesn't have any updates till now.

  • RexHopeRexHope PHMember ✭✭

    @StephenClifton.9427 said:
    @RexHope Ah, looks like the Xamarin forums took the end-bracked at the end of the link as part of the link. I should have been: https://github.com/xamarin/GooglePlayServicesComponents/issues/384

    I'd not seen the issue you'd mentioned (385) but will try to follow through the steps later to see if that would work around the problem I was seeing. Thanks for flagging that one.

    Apparently there's a new package official version for crash https://www.nuget.org/packages/Xamarin.Firebase.Crash/116.2.1 . Is this in line with crashlytics or is this a different package?

  • Firebase Crashlytics does handle C# crashes with full de-obfuscated stack traces, and groups related crashes together to make it easier to see the wood from the trees. Plus we'd already been using Firebase for Analytics, so having everything in the same portal was useful. We can get by with crashes in AppCenter for the moment (we'd used HockeyApp years ago so already had a lot of it setup), but it doesn't seem like the best solution having things split over several portals.

  • MarkRileyMarkRiley GBMember ✭✭

    @StephenClifton.9427 Thanks for the info, didn't realise that Crashlytics could include C# stack traces as well. Personally it would by my preference since I already use it in the iOS version of my app, but had avoided it till now for Android since I assumed it would only include the Java stack trace.

  • Someone's been through and got the new NuGets working for Firebase Crashlytics, and put their steps here:
    https://github.com/a-imai/XamarinCrashlyticsUpgradeSample

    I've given it a run through and seen Firebase acknowledge it's using the latest Firebase library (so not warning about the November deadline), and showing non-fatal exceptions, and have seen a fatal exception arrive too (though was expecting to see two), but progress!

  • RexHopeRexHope PHMember ✭✭
    edited October 26

    Yea, > @StephenClifton.9427 said:

    Someone's been through and got the new NuGets working for Firebase Crashlytics, and put their steps here:
    https://github.com/a-imai/XamarinCrashlyticsUpgradeSample

    I've given it a run through and seen Firebase acknowledge it's using the latest Firebase library (so not warning about the November deadline), and showing non-fatal exceptions, and have seen a fatal exception arrive too (though was expecting to see two), but progress!

    https://www.nuget.org/packages/Xamarin.Firebase.Crashlytics/ Good news, they just released a new version!
    iOS is still on its beta https://www.nuget.org/packages/Xamarin.Firebase.iOS.Crashlytics/4.0.0-beta.7

  • nmorinagnmorinag Member ✭✭

    @StephenClifton.9427 said:
    I've given it a run through and seen Firebase acknowledge it's using the latest Firebase library (so not warning about the November deadline), and showing non-fatal exceptions, and have seen a fatal exception arrive too (though was expecting to see two), but progress!

    Thanks a lot! I've done the step by step in Xamarin.Android, and it worked! Now, is there any news about the stable version of crashlytics for iOS?

  • FathimaFathima Member

    I have followed the steps mentioned by @ StephenClifton.9427, I was able to see the crash report in crashlytics console, but it is random. Not all crashes are reported. Can anyone help me on this?

  • I've just seen the iOS Crashlytics nuget got updated and is now out of preview as of 20 hours ago (https://www.nuget.org/packages/Xamarin.Firebase.iOS.Crashlytics/4.6.2), I'll give that a go shortly - hopefully it'll fix things not showing up for iOS (I saw one non-fatal appear once and no fatals with the preview and nothing since).

    As for Android being intermittent it seemed to work when I'd tried it (just a few times), but will try to get more testing around this to see how it's performing.

  • nmorinagnmorinag Member ✭✭

    I've updated the Xamarin.Firebase.iOS.Crashlytics to the latest version, but it's not registering the crash events... I don't have an actual device for testing, does the iOS Simulator have some kind of restriction? Do I have to build the project in Release mode? Also, is the call Crashlytics.SharedInstance.Init() required? I tried without it, but in the output the crashlytics it seemed like it wasn't starting.

    2020-11-09 15:54:20.014420-0300 [Firebase/Crashlytics] Version 4.6.2
    2020-11-09 15:54:20.359891-0300 6.34.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60900000 started
    2020-11-09 15:54:20.405084-0300 6.34.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled
    2020-11-09 15:54:20.707704-0300 6.34.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
    2020-11-09 15:54:20.851704-0300 6.34.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
    2020-11-09 15:54:20.853732-0300 6.34.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist

  • @nmorinag I'd just been running some tests (though these had been using a physical iPhone), sending up a non-fatal exception on app start, and triggering a fatal on another UI action. I had been seeing the non-fatals come through from iOS no problem (after maybe a 5 minute delay, sometimes needing to change the time window on Firebase between last-60-minutes and last 24-hours, but they showed.

    The fatal exceptions hadn't been showing up though, but found that as the app had Ads, the MobileAds SDK has been grabbing the crashes first. I needed to add the following in the AppDelegate:

    MobileAds.SharedInstance.DisableSdkCrashReporting();
    

    to stop AdMob swallowing the crashes. Crashes do show now in Firebase Crashlytics.

    In the section of the app that setup Crashlytics I currently have the following (probably overkill but I'd just been working to get the crashes showing at all, and will tidy up later)

    Crashlytics.SharedInstance.Init();
    Crashlytics.SharedInstance.SetCrashlyticsCollectionEnabled(true);
    Crashlytics.SharedInstance.SendUnsentReports();
    

    I hope this helps

  • nmorinagnmorinag Member ✭✭
    edited November 10

    Thanks @StephenClifton.9427, I've made the changes, and I asked someone to test the crash on an actual device, because it's still not registering the crashes on the simulator.

  • nmorinagnmorinag Member ✭✭

    Just an update, on the actual device it worked, and now the SDK message on the firebase console has changed to:
    "You have the latest SDK installed
    We have received a crash with the latest SDK"

    Thank you all!

  • srixsrix Member
    edited November 11

    @StephenClifton.9427 , @nmorinag , I'm still getting the upload missing 2 dsyms error message(Please upgrade to the Firebase Crashlytics SDK by November 15, 2020 ) in firebase console after uploading of dsyms. could you please explain me how to upload to upload. I have tried in actual device as well. Im using VS 2019 with Xamarin Forms. Any help would be appreciated.

  • mac121mac121 Member ✭✭✭

    Hi all, after upgrading to v4.6.2 I'm getting error on build
    Bundle Resource 'libGoogleAnalytics.a' not found on disk (should be at 'E:\ProjName\iOS\GAnlytcs-3.17\Libraries\libGoogleAnalytics.a')

    Can any of you please share the package version details for Firebase Crashlytics SDK and Google Mobile Ads? I need this for iOS project. I'm using a Xamarin.Forms project

  • HenryLisowskiHenryLisowski USMember ✭✭

    This thread has been invaluable as we've finally been able to upgrade to Firebase Crashlytics, so thanks all for the help (that github documentation link was especially useful). I'm just now trying to figure out a few remaining bugs, and was hoping someone here had run into and solved them already.

    Platform: Android
    Setup:
    Currently using latest nuget of Xamarin.Firebase.Crashlytics, Xamarin.GooglePlayServices.Ads (no firebase integration) and with this upgrade we also added Xamarin.Firebase.Analytics.

    TLDR:
    1) All crashes in console now show up under JavaProxyThrowable or RunnableImplementor, instead of the actual managed exception name, so all our crashes are grouped in a few very large blobs and it's impossible to navigate. Is there a way to fix this?
    2) All our crashes are coming in as NonFatal, possibly due to an old attempt to register to AppDomain.UnhandledException to handle previously uncaught native exceptions. Is anyone seeing this same problem, and does anyone still register to the UnhandledException event?
    3) I disabled by default all id collection when adding Analytics, but I have no idea what ssaid is or if me disabling it might be contributing to other issues, does anybody else have experience with these?

    Problem 1:
    Previously when crashes showed up in Firebase console, it'd be the proper C# exception name. The old library we were using allowed us to call RecordException and pass in our System.Exception, so it was formatted nicely (Crashes in console were grouped by exception type and message). The new Xamarin.Firebase.Crashlytics expects a Java.Lang.Throwable. I read around that we can just use Java.Lang.Throwable.FromException to convert between the two, but now the crashes in the console are all garbage. Pretty much all our crashes are now grouped under a single "Crash", being
    Non-fatal Exception: android.runtime.JavaProxyThrowable:
    With the actual C# exception being part of the message. The stack trace is technically there (most of the time) but in a big blob at the top of the message. Sometimes there is no managed stack trace at all, and it says the crash originated at either Activity1.cs or mono.java.lang.RunnableImplementor.n_run(RunnableImplementor.java).

    Does anyone know how I can get my proper managed stack traces and groupings back? This is happening both for fatal crashes (more on that below) and non fatals where I either RecordException the caught exception, or RecordException a NEW exception based on a non-exception error.

    Problem 2:
    We're not getting any "Fatal" crashes at all anymore, all of them are non-fatal, and as much as I'd like to believe that I randomly without trying fixed all crashes in our app, that's probably not likely. With our old library it sometimes struggled to catch native crashes, so it was suggested to do this:

    AppDomain curAppDomain = AppDomain.CurrentDomain;
    curAppDomain.UnhandledException += CurAppDomain_UnhandledException;
    
    

    and then handle UnhandledExceptions like this:

    private void CurAppDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
         Firebase.Crashlytics.FirebaseCrashlytics.Instance.RecordException(Java.Lang.Throwable.FromException(e.ExceptionObject as Exception));
    }
    

    And I'm wondering if that is somehow, with new Firebase Crashlytics, causing Crashlytics to fail to properly catch fatal crashes and instead just report them as nonfatal.

    Problem 3:
    I added Firebase Analytics to get the interop with Crashlytics information (crash free users) but I don't want to start collecting any more information than I was previously, since I don't want to have to update any terms agreements. I have the following in my manifest:

    meta-data android:name="firebase_crashlytics_collection_enabled" android:value="false"
    meta-data android:name="google_analytics_adid_collection_enabled" android:value="false"
    meta-data android:name="google_analytics_ssaid_collection_enabled" android:value="false"
    meta-data android:name="google_analytics_default_allow_ad_personalization_signals" android:value="false"
    

    And when the user agrees I now enable Crashlytics CrashRecording as well as Analytics. I know I don't want to collect adid, but I couldn't find a good explanation anywhere about ssaid, and so I'm not sure if disabling that has caused any of the above problems in crashlytics. Does anyone have a good explanation/experience with these ids and can tell me if I screwed something up?

    Thanks again for anyone who helps, I have no idea how I could figure out half this stuff without you all =D

Sign In or Register to comment.