DixieFlatline DixieFlatline - 5 months ago 254
Swift Question

Firebase crash reporting for iOS doesn't send crashes despite successful init

I added firebase crash reporting to my iOS project (added pod, added build phase script, added json to project, ...).
When i run my app, i see in my console:

Firebase Crash Reporting: Successfully enabled


For testing, i insert fatalError() in my code after my FIRApp.configure() code (as suggested here: https://firebase.google.com/docs/crash/ios#create_your_first_error).

No crash reports are sent at my next app launch (that doesn't crash). I see nothing in my xcode console and nothing in my web console.

Answer

Not an immediate solution, but some diagnostic tricks that may help locate the problem:

  • Make sure that the debugger is DISABLED when you generate the crash in the simulator or attached device, or the debugger will grab the crash before FCR does. Launch the app (⌘R) in Xcode, stop the debugger (⌘.) in Xcode, and re-launch the app manually in the simulator or on the device.
  • If you are using the simulator and you follow the above instructions, then you should see the raw crash dumps produced if you execute the command find ~/Library/Developer/CoreSimulator -path '*/FCRDumps/*.dmp' -ls (note that unprocessed crashes from other test apps will also be displayed).
  • If you see one or more dump files with the right timestamp, then you should get a successful upload the next time the app launches. Remove the fatalError() line, then rebuild and relaunch. The .dmp files in that container should soon disappear, replaced by .crash files (use find ~/Library/Developer/CoreSimulator -path '*/FCRCrashQueue/*.crash' -ls to find them). The crash files will be deleted one at a time after they successfully upload.