Search code examples
ioscrashlyticsgoogle-fabric

Non-fatal errors not showing in Crashlytics


I was testing the non-fatal error functionality of Crashlytics and can't seem to get the recorded errors to appear in Crashlytics.

I did initialize Crashlytics in AppDelegate like this:

Fabric.with([Crashlytics.self])

And I test send error like this (the test code is in viewDidLoad method):

let error = NSError(domain: "myDomain", code: 1000, userInfo: nil)
Crashlytics.sharedInstance().recordError(error)

But nothing shows up in the analytics. I tried to:

  • Restart application
  • Disconnect from debugger and run the application several times
  • Add regular crash using Crashlytics.sharedInstance().crash(). In that case only the fatal crash is reported
  • I waited 4 days for the data to show up

enter image description here

Versions:

  • Crashlytics (3.8.5)
  • Fabric (1.6.12)

Thanks


Solution

  • I found what was the problem:

    The application code was embedded in a framework. My tip is that the non-fatal logs were saved in the framework's bundle not the main bundle. On the next start the main bundle was searched for logs but none was found, thus nothing was sent.

    My solution was remove the app from framework as it was no longer needed in the project. I am not sure how this would be solved if you would need to keep the code in the framework.