28

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!

Stephen McCormick
  • 1,706
  • 22
  • 38
  • Where did u see it's deprecated? From the v2.2.4 [doc](http://docs.fabric.io/javadocs/crashlytics/2.2.4/com/crashlytics/android/Crashlytics.html#logException(java.lang.Throwable)) it doesn't seem to be the case. – Aaron He Jun 01 '15 at 23:00
  • Yeah - my thought exactly! But inside of Eclipse it is marking as deprecated (it was not before the 2.2.4 upgrade I did today). But as you state, their documentation does not state that. I can only assume they are deprecating it because it is not supported in IOS? Or they are getting too much traffic? – Stephen McCormick Jun 01 '15 at 23:22

4 Answers4

32

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

YenMinh
  • 509
  • 5
  • 12
18

After migration from fabric to firebase crashlytics...

FirebaseCrashlytics.getInstance().recordException(e);
Tom
  • 6,946
  • 2
  • 47
  • 63
8

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

joelreeves
  • 1,955
  • 1
  • 18
  • 24
  • 1
    Try not to link provide link only answers as links can break or their content change, instead provide the relevant code samples or content directly in your answer and link back to the source. I'll remove the downvote if you update your question – TheIT Jun 13 '16 at 20:34
7

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

Phileo99
  • 5,581
  • 2
  • 46
  • 54