Crashlytics 没有从 iPhone 上发送 Crash 报告

我已经在我的一个 iOS 应用程序中设置了 Crashlytics,并将该应用程序安装在一个真正的设备上。我的 Crashlytics 仪表板正在显示,我已经成功地添加了应用程序。但是,它没有发送坠机报告。我的网速不太好。但我可以用这个设备查看邮件。有人能猜到问题出在哪里吗?

61596 次浏览

Have you tried running [[Crashlytics sharedInstance] crash] on a device and seeing if that gets reported? There are a few reasons why Crashlytics might not work including other crash reporters etc.

Crashlytics works for me until now. I don't know why but now it doesn't work.

You should turn debug-mode on by

[Crashlytics sharedInstance].debugMode = YES;

My problem is here Crashlytics error code: 202 when Submitting files :(

Make sure you are not forcing the crash too early.

Set [Crashlytics sharedInstance].debugMode to YES;

Watch for

Crashlytics] Settings loaded

on the Xcode console logs.

Then force the crash and restart the app, and the crash will be reported now.

Xcode debugger does NOT allow Crashlytics to process crash reports. Yeah, that seem weird even to me when I read that first time but it is a fact (Source). That's is the reason we never see crash report When:
- running app in Simulator
- running app on iDevice by directly build and run from Xcode with debugger on.

To make sure a crash is reported during your testing (copied from Crashlytics support site):
1. Launch simulator
2. Press stop
3. Launch your app and force a crash
4. Relaunch the app from simulator
5. See the crash report in the web dashboard.

EDIT:

Added a reference; Crashlytics also provides a short article on a quick way to force a crash.

If you don't upload the dSYM file, Crashlytics will not show your crash even though the report successfully uploaded.

You could run into this problem, if you have set up your build-script to only run on your CI server. Then if you have copied your app to your phone via xcode and you run it without being attached to the debugger, the report will be uploaded but ignored, because of the missing dSYM file.

The primary reason any crash reporter won't work on iOS is due to interference from different crash reporters. However, with Crashlytics specifically there could be something specific to them causing the crash report not getting reported.

Xcode debugger does NOT allow Any Crash Reporter to process crash reports. This is because XCode overrides any hooks into the crash handling call backs. This only happens when:

  • running app in Simulator (with debugger on)
  • running app on iDevice by directly build and run from Xcode with debugger on.

To make sure a crash is reported during your testing (http://support.crashlytics.com/knowledgebase/articles/92523-why-can-t-i-have-xcode-connected-):

  1. Launch simulator
  2. Press stop
  3. Launch your app and force a crash
  4. Relaunch the app from simulator
  5. See the crash report in the web dashboard.

While a super old video it's still relevant, here's a video of the steps above (example from Crittercism): https://www.youtube.com/watch?v=sU6Su3PBFH4

We recently ran into this issue and I found that somewhere along the way the build script was removed. Adding it back in with the following fixed the issue for us:
./Crashlytics.framework/run <your_api_key> <build_secret>

Note : When using Cocoapods you will want to us the following instead of the above (source): ./Pods/CrashlyticsFramework/Crashlytics.framework/run

Adding a build script:

  1. To add a Run Script Build Phase in Xcode 6, select your application target in your project, then select "Build Phases".
  2. Click the small "plus" icon and select "New Run Script Build Phase".
  3. You should now see a Run Script section in the middle of your Build Phase options, as shown above.
  4. Inside the body of the Run Script Build Phase, paste in the script.`

The above quote comes from Crashlytics's visual tutorial, referenced in this post.

Note: I originally posted this answer verbatim for Crashlytics error code: 202 when Submitting files.

I solved by deselecting "Run Script only when installing" option in Run script (one for Fabric(crashlytics))

enter image description here

From the RayWenderlich site:

You won’t get any crash reports if Xcode intercepts the crash event! To make all the examples below work, you have to build and run the application, then click the stop button on Xcode. This way you will have the latest version installed on the the device. Once that is done, you can launch the app on the device itself, and then crash it all you want! All the crashes on your iOS device will be caught and sent to the server component of the service that you have integrated into the app. Crash reports are usually sent to the server the next time you start the app, so the steps to follow to generate a crash report on the server are as follows: Build and run on Xcode. Press the stop button. Run the app on your iOS device. Make the app crash. Run the app again.

My be it's late but work 100%

Make some changes in project build settings like in below image

enter image description here

and follow these instructions.

This is for xcode 9, from crashlytics 3.4.0 STEP1 STEP2

After doing this, be patient and wait for a few minutes.

This worked for me,

If you're testing on iDevice, just unplug iDevice with your Xcode and run your app. Now, If crashed it will be updated on dashboard.

I ran into a similar problem when trying the test crash code.

Crashlytics.sharedInstance().crash()

I was running my app from a device, without Xcode, and the crash wouldn't show up on Crashlytics Dashboard. What worked for me was the following tip from Crashlytics website:

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

I commented out the above crash() call, and re-ran the app. Then the crash showed up in the Dashboard.

For me, the problem was that the device was connected to my Mac :) From this source:

Also, if you have your device connected to your Mac, XCode's debugger will step in as well. So just disconnect the device before testing :)

Sometimes, it takes some time for the logs to show up. I am able to find them after 15-20 mins

I found solution using following steps
1. Go to Edit Scheme 2. Run -> Info 3. Change Build Configuration to release. Now run the app crash it. You will receive mail.

One of the issue I feel that in the Run Script Phase, it should be a separate Run Script Phase for CrashLytics. When had the run script

./Fabric.framework/run

With some of my other script, everything was ok, CrashLytics log show report submitted, but nothing was in the web interface.

When I add another Run script phase only with Fabric run, it appears like a magic :)

My first try was with cocoapods, but that did not work. When I manually add all the framework and a separate run script phase that worked.