ios Crashlytics 不会从 iPhone 发送崩溃报告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17818428/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 00:28:53  来源:igfitidea点击:

Crashlytics is not sending Crash report from iPhone

ioscrashcrash-reportscrashlytics

提问by farhad rubel

I've setup the Crashlytics in my one iOS application and installed the application on a real device. My Crashlytics Dashboard is displaying that, I've successfully added the app. However, it's not sending crash report. My internet speed is not so good. But I can check my emails from this device. Can anybody guess, where is the problem?

我已经在我的一个 iOS 应用程序中设置了 Crashlytics,并将该应用程序安装在一台真实设备上。我的 Crashlytics 仪表板显示,我已成功添加该应用程序。但是,它不会发送崩溃报告。我的网速不是很好。但我可以从这个设备查看我的电子邮件。谁能猜到问题出在哪里?

回答by Saurabh Hooda

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.

Xcode 调试器不允许 Crashlytics 处理崩溃报告。是的,当我第一次阅读时,这对我来说也很奇怪,但这是事实(来源)。这就是我们在以下情况下从未看到崩溃报告的原因:
- 在模拟器中
运行应用程序 - 通过在调试器打开的情况下直接从 Xcode 构建和运行在 iDevice 上运行应用程序。

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.

确保在测试期间报告崩溃(从 Crashlytics 支持站点复制):
1. 启动模拟器
2. 按停止
3. 启动您的应用程序并强制崩溃
4. 从模拟器重新启动应用程序
5. 查看崩溃报告网络仪表板。

EDIT:

编辑:

Added a reference; Crashlytics also provides a short article on a quick way to force a crashand an article on why you don't see the data from your first crash.

添加了参考;Crashlytics 还提供了一篇关于强制崩溃的快速方法的简短文章和一篇关于为什么看不到第一次崩溃的数据的文章。

回答by Anand Suthar

My be it's late but work 100%

我是迟到了,但工作 100%

Make some changes in project build settings like in below image

在项目构建设置中进行一些更改,如下图所示

enter image description here

在此处输入图片说明

and follow these instructions.

并遵循这些说明。

回答by Eddie Freeman

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.

任何崩溃报告器无法在 iOS 上工作的主要原因是由于来自不同崩溃报告器的干扰。但是,特别是对于 Crashlytics,可能会有一些特定的东西导致崩溃报告没有得到报告。

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

Xcode 调试器不允许Any Crash Reporter处理崩溃报告。这是因为 XCode 覆盖了崩溃处理回调中的任何挂钩。这只发生在:

  • running app in Simulator (with debugger on)
  • running app on iDevice by directly build and run from Xcode with debugger on.
  • 在模拟器中运行应用程序(打开调试器)
  • 通过在调试器打开的情况下直接从 Xcode 构建和运行,在 iDevice 上运行应用程序。

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

确保在测试期间报告崩溃(http://support.crashlytics.com/knowledgebase/articles/92523-why-can-ti-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.
  1. 发射模拟器
  2. 按停止
  3. 启动您的应用程序并强制崩溃
  4. 从模拟器重新启动应用程序
  5. 查看 Web 仪表板中的崩溃报告。

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

虽然它仍然是一个超老视频,但这是上述步骤的视频(来自 Crittercism 的示例):https: //www.youtube.com/watch?v=sU6Su3PBFH4

回答by Fengson

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

对我来说,问题是该设备已连接到我的 Mac :) 来自此来源

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 :)

此外,如果您将设备连接到 Mac,XCode 的调试器也会介入。所以只需在测试前断开设备:)

回答by Gurjinder Singh

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.

我使用以下步骤找到了解决方案
1. 转到编辑方案 2. 运行 -> 信息 3. 将构建配置更改为发布。现在运行应用程序使其崩溃。您将收到邮件。

回答by James Nelson

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>

我们最近遇到了这个问题,我发现在构建脚本的某个地方被删除了。使用以下内容重新添加它为我们解决了问题:
./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

注意:使用 Cocoapods 时,您需要使用以下内容而不是上述内容(来源): ./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.`
  1. 要在 Xcode 6 中添加运行脚本构建阶段,请在项目中选择您的应用程序目标,然后选择“构建阶段”。
  2. 单击小“加号”图标并选择“新建运行脚本构建阶段”。
  3. 您现在应该在构建阶段选项的中间看到一个运行脚本部分,如上所示。
  4. 在运行脚本构建阶段的主体内,粘贴脚本。`

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

以上引用来自 Crashlytics 的可视化教程,在这篇文章中引用。

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

注意:我最初为Crashlytics error code: 202 when Submitting files逐字发布了这个答案。

回答by Michel Go?i

From the RayWenderlich site:

从 RayWenderlich 网站:

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.

如果 Xcode 拦截崩溃事件,您将不会收到任何崩溃报告!要使下面的所有示例都能正常工作,您必须构建并运行应用程序,然后单击 Xcode 上的停止按钮。这样,您将在设备上安装最新版本。完成后,您可以在设备本身上启动应用程序,然后随心所欲地使其崩溃!您的 iOS 设备上的所有崩溃都将被捕获并发送到您已集成到应用程序中的服务的服务器组件。崩溃报告通常会在您下次启动应用程序时发送到服务器,因此在服务器上生成崩溃报告的步骤如下: 在 Xcode 上构建并运行。按下停止按钮。在您的 iOS 设备上运行该应用程序。使应用程序崩溃。再次运行应用程序。

回答by Ravi

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:

我在没有 Xcode 的情况下从设备运行我的应用程序,并且崩溃不会显示在 Crashlytics Dashboard 上。对我有用的是来自 Crashlytics 网站的以下提示:

  • 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.

我注释掉了上面的 crash() 调用,并重新运行了应用程序。然后崩溃出现在仪表板中。

回答by Tony

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

到目前为止,Crashlytics 对我有用。我不知道为什么,但现在它不起作用。

You should turn debug-mode on by

您应该通过以下方式打开调试模式

[Crashlytics sharedInstance].debugMode = YES;

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

我的问题是在这里Crashlytics 错误代码:提交文件时为 202:(

回答by erkanyildiz

Make sure you are not forcing the crash too early.

确保您没有过早地强迫崩溃。

Set [Crashlytics sharedInstance].debugModeto YES;

设置[Crashlytics sharedInstance].debugModeYES;

Watch for

留意

Crashlytics] Settings loaded

on the Xcode console logs.

在 Xcode 控制台日志上。

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

然后强制crash,重启app,现在就报crash了。