Search code examples
androidcrashlyticsgoogle-fabriccrashlytics-android

Do I need to initialize Crashlytics if I need to log non-fatal exception?


Before I called the method

Crashlytics.getInstance().core.logException(new Exception("..."))

Do I need to initialize Crashlytics like this

Fabric.with(this, new Crashlytics());

though I've initialized in the main screen?


Solution

  • You should initialize Crashlytics on your application class on the onCreate() method. That way all the fatal exceptions are caught by default and when creating a log you only need to call the

    Crashlytics.getInstance()
    

    every time you need it