Firebase crashlytics not reporting crash

删除回忆录丶 提交于 2019-12-12 18:25:25

问题


I'm upgrading from Fabric to Firebase crashlytics. I've added Firebase and Fabric/Crashlytics pods to my project, added the .plist etc. All seems to be working fine, except crashes are not being reported. I'm generating a crash using assert(! "crashing on purpose to test crashlytics"); as I saw someone else mention [[Crashlytics sharedInstance] crash] didn't work for them.

What's interesting is the 'crash free users' for the build number I'm using drops to 0% after the crash is generated, but crashes is reported as 0. The dSYMs tab doesn't list the version number.

Here's the crash coming through on the debug view when -FIRDebugEnabled is passed as an argument:

Any suggestions?


回答1:


See that you have the latest pods installed, as the firebase docs says you should have this pod versions

pod 'Fabric', '~> 1.9.0'
pod 'Crashlytics', '~> 3.12.0'

Here is the link to the docs of firebase crashlitycs




回答2:


I had a similar issue when migrating from Fabric to Firebase Crashlytics. You should not follow the Firebase website instructions. Stick with the Fabric instructions as mentioned by @Ashvini. I am assuming that you already had Crashlytics working fine before migration to Firebase. I tested this approach and it works for me. This is a pain as older and newer projects will have different Crashlytics implementations.




回答3:


  • After installation make sure you have initialized Fabric SDK in your AppDelegate file by using below line of code:

    For Objective-C : [Fabric with:@[[Crashlytics class]]]; and

    For swift : Fabric.with([Crashlytics.self])

  • After that force your app to be crash by calling Crashlytics.sharedInstance().crash() for swift and [[Crashlytics sharedInstance] crash] for Objective-C. Call this method by adding any button programmatically in your ViewController or on existing action.

  • Crashlytics doesn’t capture crashes if a debugger is attached at launch, so to see the crash in action you'll need to follow these steps:

    1. Run your app from Xcode to install it on the simulator or your device
    2. Press the Stop button in Xcode to quit it
    3. Launch your app from the home screen to run it without the debugger
    4. Press the “Crash” button to trigger the crash
    5. Run the app again from Xcode so it can deliver the recorded crash to Crashlytics.
  • Within a few minutes, you should see the crash appear on your Fabric Dashboard.

  • If you didn't found crash in dashboard then Double-check in your Build Settings that your Debug Information Format is “DWARF with dSYM File” for both Debug and Release.

  • Make sure to launch the app after crashing it, so that the crash can be uploaded.

  • If you don’t see the crash after a few minutes, run your app again to retry crash delivery.

  • You can refer to this link [https://fabric.io/kits/ios/crashlytics/install] .



来源:https://stackoverflow.com/questions/54401735/firebase-crashlytics-not-reporting-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!