android – Crashlytics deprecating logException() what is the replacement?-ThrowExceptions

Exception or error:

Anyone know the replacement call in Crashlytics for logException() which seems to be deprecated as of 2.2.4? My issue is that I have exceptions that I catch, but I suspect they lead to further errors which then cause the application to crash. I want to log all handled exceptions also, and see them in one place. Was using Flurry but just didn’t seem to do the trick, where as Crashlytics looks to be more robust. I want them all in the same tool since it is a thousand times easier matching up the exceptions in just one place, rather than patching it together thru LogEntries, Flurry and Crashlytics. Once I get the major crash elements identified I will slowly remove the logException() calls and just look for real hard crashes.

thanks!

How to solve:

Here it is your : Crashlytics.getInstance().core.logException(e);

###

Crashlytics got updated to 2.3.2. If you look at that documentation it’s deprecated. Check out the new exception method here

###

Crashlytics documentation and Fabric.io documentation isn’t very clear about this, so just to be clear:

  • if you are compiling with com.crashlytics.sdk.android:crashlytics:2.2.xxx@aar or older, use this method:

    Crashlytics.logException(e);

  • if you are using com.crashlytics.sdk.android:crashlytics:2.3.xxx@aar, use this method:

    Crashlytics.getInstance().core.logException(e);

  • if you are using com.crashlytics.sdk.android:crashlytics:2.5.xxx@aar, you can use any method:

    Crashlytics.getInstance().core.logException(e);
    CrashlyticsCore.getInstance().logException(e);

    Crashlytics.logException(e);

In conlusion: if you wish to rely on the Fabric.io documentation, check to make sure you are not compiling with crashlytics v2.3.xxx

Leave a Reply

Your email address will not be published. Required fields are marked *