swiftfirebasecrashlyticscrashlytics-beta

Firebase/Crashlytics Version 4.0.0-beta.1 - ForceCrash?


How do you force a crash on the new version of Firebase Crashlytics 4.0.0-beta.1?

I have tried to crash the app with fatalError(), but the Crashlytics doesn't record the crash in Dashboard.

Also tried to unplug my device, run the app and force crash with fatalError() but still no report in Dashboard.

Also tried Crashlytics.sharedInstance().crash(), but getting error message Type 'Crashlytics' has no member 'sharedInstance()'.

Any ideas? Thank you


Solution

  • As the documentation says, use

    Crashlytics.sharedInstance().crash()
    

    Crash reports are sent to the server when you start the app again.

    Option2: If nothing works, just declare an optional and force unwrap it. :) CRASH

    var v : Int!
    
    // then in your viewDidLoad() or in button action
    let a = v!