首页 > 解决方案 > Unity 崩溃报告数组为空

问题描述

我是 C# 和 unity 的新手,我试图在我的 API 中获取统一崩溃报告,但是当我调用 CrashReport.reports 时,我总是得到一个空数组,尽管事实上在统一存储的文件夹中存在一些崩溃报告崩溃细节%USERPROFILE%\AppData\Local\Temp\Unity\Editor\Crashed\。在我的服务中,我有:

public void Initialize()
    {

       var crashReports = CrashReport.reports;  // this always returns empty
       ...
    }

我是否缺少任何配置?

标签: c#unity3d

解决方案


登录%USERPROFILE%\AppData\Local\Temp\Unity\Editor\Crashed\只是统一编辑器崩溃日志,而不是您的应用程序的日志。

此外,CrashReport目前仅在 iOS 中可用。 https://docs.unity3d.com/2019.3/Documentation/ScriptReference/CrashReport.html

Note: this API currently is available only for iOS targets.

推荐阅读