ios Crashlytics 不显示崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39856414/
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
Crashlytics does not show crashes
提问by Avt
I have just installed Crashlitycs using thisofficial instruction.
我刚刚使用此官方说明安装了 Crashitycs 。
I have set Debug Information Format is “DWARF with dSYM File” for both Debug and Release and disabled Bitcode (some people wrote that it could help):
我已经将调试信息格式设置为“带有 dSYM 文件的 DWARF”,用于调试和发布以及禁用的 Bitcode(有些人写道它可以提供帮助):
AppDelegate:
应用委托:
Fabric.sharedSDK().debug = true
Fabric.with([Crashlytics.self])
To simulate a crash I use
为了模拟我使用的崩溃
Crashlytics.sharedInstance().crash()
and
和
var ggg: Int!
print(ggg)
Crashlitics collects some information about sessions. For example it updates bundle versions info:
Crashlitics 收集有关会话的一些信息。例如它更新捆绑版本信息:
So connection with Crashlitics works. However crash information is empty:
因此与 Crashlitics 的连接有效。但是崩溃信息是空的:
I am using XCode 8 and iOS 9/10. What I am doing wrong?
我正在使用 XCode 8 和 iOS 9/10。我做错了什么?
EDIT:
编辑:
I have tested it on simulator and device without XCode debugger connection (i.e. launching from sumulator/device screen)
我已经在没有 XCode 调试器连接的模拟器和设备上对其进行了测试(即从 sumulator/设备屏幕启动)
Finally I have received some Crashlytics reports after 7-8 hours after crashes. I expected them earlier because according to documentation:
最后,我在崩溃后 7-8 小时收到了一些 Crashlytics 报告。我早料到他们,因为根据文件:
Within a few minutes, you should see the crash appear on your Fabric Dashboard.
几分钟后,您应该会在 Fabric 仪表板上看到崩溃。
However I did not receive all crashes I was waiting for. During my experiments I have tried different ways to initialise Crashlytics:
但是,我并没有收到我一直在等待的所有崩溃。在我的实验中,我尝试了不同的方法来初始化 Crashlytics:
Fabric.with([Crashlytics.self])
and
Fabric.with([Crashlytics.self()])
Could it be the reason? I have also found the similar unanswered question.
这可能是原因吗?我也发现了类似的未回答的问题。
回答by Rahul Verma
Checked the following terms,
检查了以下条款,
Make sure Crashlytics SDK line is after all other 3rd-party SDK lines. (it needs to be last one called in your appDidFinishLaunching method.)
Force a crash and then relaunch the app. Xcode must be disconnected to stop it from intercepting the crash report. To disconnect Xcode, follow the instructions here.
If you're using [Crashlytics sharedInstance] crash]; to test crashing, make sure it's not in the appDidFinishLaunching method.
确保 Crashlytics SDK 行在所有其他 3rd 方 SDK 行之后。(它需要是在您的 appDidFinishLaunching 方法中调用的最后一个。)
强制崩溃,然后重新启动应用程序。Xcode 必须断开连接才能阻止它拦截崩溃报告。要断开 Xcode,请按照此处的说明进行操作。
如果您使用的是 [Crashlytics sharedInstance] crash]; 要测试崩溃,请确保它不在 appDidFinishLaunching 方法中。
These are already mentioned in support section, Here is additional ones -
这些已经在支持部分提到过,这里是额外的 -
- Check in organization -> Your App -> Missing dSYM, Is it showing any missing dSYM file
- 签入组织 -> 您的应用程序 -> 缺少 dSYM,是否显示任何缺少的 dSYM 文件
if yes, Then do the following step
如果是,则执行以下步骤
- Right Click on your archive -> Show in Finder -> Right click on file and click on Show package contents
- Right click on dSYM file - > Show package contents -> Contents -> Resources -> DWARF (Open in terminal)
- Run command dwarfdump --uuid "file name you saw there in dwarf folder"
- 右键单击您的存档 -> 在 Finder 中显示 -> 右键单击文件并单击显示包内容
- 右键单击 dSYM 文件 -> 显示包内容 -> 内容 -> 资源 -> DWARF(在终端中打开)
- 运行命令 dwarfdump --uuid "您在 dwarf 文件夹中看到的文件名"
This will show all the associated UUID, And if any listed UUID matched with the one mentioned in missing dSYM id then just compress the dSYM folder and upload it on crashlytics Missing dSYM segment.
这将显示所有关联的 UUID,如果任何列出的 UUID 与缺失 dSYM id 中提到的 UUID 匹配,则只需压缩 dSYM 文件夹并将其上传到 crashlytics Missing dSYM 段。
This step is important cause sometimes the dSYM file we extract from organizer doesn't contain correct UUID. And after uploading the wrong one we wait for its updations. So it's better to make sure you are uploading the right dSYM file.
这一步很重要,因为有时我们从管理器中提取的 dSYM 文件不包含正确的 UUID。在上传错误的之后,我们等待它的更新。所以最好确保你上传了正确的 dSYM 文件。
Other than aforementioned things, Bitcode property and Debug Information Format in Build Settings also affect the crash reporting.
除上述内容外,Build Settings 中的 Bitcode 属性和调试信息格式也会影响崩溃报告。
回答by Zac Kwan
You need to run the app but not from Xcode.
您需要运行该应用程序,但不需要从 Xcode 运行。
If you are using a device, just launch the app without usb connected. If you are using simulator, stop the running of the app from Xcode. Then open it again via mouse click instead.
如果您使用的是设备,只需在没有连接 USB 的情况下启动应用程序。如果您使用的是模拟器,请停止从 Xcode 运行应用程序。然后通过鼠标点击再次打开它。
Next, navigate to the buttonPress
or function
that will call the Crashlytics.sharedInstance().crash()
.
接下来,导航到buttonPress
或function
将调用Crashlytics.sharedInstance().crash()
。
Then reopenthe app again after crash.(This could be connected to console if you want) This step is important because crashlytics save the crash report just before the app is terminated. The next time you open the app, it will then post the report up to crashlytics.
然后在崩溃后再次重新打开应用程序。(如果需要,这可以连接到控制台)这一步很重要,因为 crashlytics 会在应用程序终止之前保存崩溃报告。下次您打开应用程序时,它会将报告发布到 crashlytics。
The docs hereactually explain the troubleshooting issue as well.
这里的文档实际上也解释了故障排除问题。
回答by Parth
Double-check in your Build Settings that your Debug Information Format is “DWARF with dSYM File” for both Debug and Release
仔细检查你的构建设置,你的调试信息格式是“DWARF with dSYM File”,用于调试和发布
回答by Michael
Still relevant in 2019.
在 2019 年仍然相关。
Just like Zac Kwansaid, you have to do this without your app instance attached to Xcode.
就像Zac Kwan所说的,你必须在没有你的应用程序实例附加到 Xcode 的情况下做到这一点。
If you're following thesedocs, they make you understand it as, you add the needed information, then to test, press the crash button, then relaunch, all via Xcode.
如果您遵循这些文档,它们会让您理解为,您添加所需的信息,然后进行测试,按下崩溃按钮,然后重新启动,全部通过 Xcode。
Do the following:
请执行下列操作:
- Add the needed Crashlytics information to your project. Run it in Xcode once. Then go ahead and manually go to your simulator, open your app, force the crash.
- You should get an email about a "Fatal Error".
- About 5-10 minutes later, it will show in your Firebase console.
- 将所需的 Crashlytics 信息添加到您的项目中。在 Xcode 中运行一次。然后继续手动转到您的模拟器,打开您的应用程序,强制崩溃。
- 您应该会收到一封关于“致命错误”的电子邮件。
- 大约 5-10 分钟后,它会显示在您的 Firebase 控制台中。
回答by chadnewbry
Another potential cause of crashes not uploading is implementing the Crashlytics delegate without calling the completion handler:
未上传崩溃的另一个潜在原因是在不调用完成处理程序的情况下实现 Crashlytics 委托:
// MARK: CrashlyitcsDelegate
func crashlyticsDidDetectReport(forLastExecution report: CLSReport, completionHandler: @escaping (Bool) -> Void) {
// Last launch we crashed!
}
}
Instead, it should look like this:
相反,它应该是这样的:
// MARK: CrashlyitcsDelegate
func crashlyticsDidDetectReport(forLastExecution report: CLSReport, completionHandler: @escaping (Bool) -> Void) {
// Last launch we crashed!
completionHandler(true)
}
}