- Home /
iOS CrashReport never getting populated after crahes
So I'm trying to implement the new CrashReport API running Unity Pro and iOS Pro (4.2.0f4) and deploying to a device (ipad mini), but the CrashReport.latestReport and CrashReport.reports objects are never populated even after I force an unhandled exception. My CrashReporter.h looks as follows:
// Enabling this will force app to do a hard crash instead of a nice exit when UnhandledException
// is thrown. This will force iOS to generate a standard crash report, that can be submitted to
// iTunes by app users and inspected by developers.
#define ENABLE_IOS_CRASH_REPORTING 1
// Enable custom crash reporter to capture crashes.
#define ENABLE_CUSTOM_CRASH_REPORTER 1
// Enable submission of custom crash reports to Unity servers. This will enable custom crash
// reporter.
#define ENABLE_CRASH_REPORT_SUBMISSION 1
#if ENABLE_CRASH_REPORT_SUBMISSION && !ENABLE_CUSTOM_CRASH_REPORTER
#undef ENABLE_CUSTOM_CRASH_REPORTER
#define ENABLE_CUSTOM_CRASH_REPORTER 1
#endif
void WaitWhileCrashReportsAreSent();
void SubmitCrashReportsAsync();
void InitCrashReporter();
and my method to report the crashes looks like this (SendDirectFeedback is a method that sends a feedback email to our dev team via TestFlight):
public static string SendMostRecentCrashReport()
{
Debug.Log("Sending most recent crash report if it exists");
#if UNITY_IPHONE
var report = CrashReport.lastReport;
if (report != null || (CrashReport.reports != null && CrashReport.reports.Length > 0))
{
Debug.Log("crash report exists. Report count: " + CrashReport.reports.Length);
if (report == null)
report = CrashReport.reports[0];
string crashReport = "App encountered crash, but was able to gather the following crash report on restart: " +
"\nTime: " + report.time.ToString("G") +
"\nReport: " + report.text;
SendDirectFeedback(crashReport);
return crashReport;
}
#endif
return null;
}
but I return null every time (and obviously never get the email via TestFlight). Has anyone else had any luck with this new feature? Did I miss some other setup step or does it only handle certain types of exceptions? I've tried running as a development build and not as a development build, but I get the same behavior either way. Thanks for any help. Also, I tried to tag this question as "CrashReport" but since I don't have 50 rep it won't let me create a new tag.
Hey - do you $$anonymous$$d sharing how did you induce a crash?
Answer by unimechanic · Sep 25, 2013 at 04:20 PM
In Player Settings, you have to set Script Call Optimization to "Fast but not Exceptions". Otherwise Unity will catch the exception, and will try to keep running without populating the reports. Our developers will highlight this in the docs. Also, have in mind that XCode intercepts the crash, and doesn't allow the crash reporter to save this information. You have to launch the app directly from device.
Answer by aaefiikmnnnr · Dec 10, 2015 at 05:08 PM
iOS intermediately kills the process after uncaught exception happened. So the crash report cannot be sent. Unity guys said that they are working on storing crash report on storage and send it at next session in the following forum thread.
http://forum.unity3d.com/threads/getting-reports-on-android-but-not-ios.368421/
Your answer
Follow this Question
Related Questions
ArgumentOutOfRangeException when calling CrashReport.reports 0 Answers
[URGENT] OpenFeint integration problems 0 Answers
iOS app crash randomly !!! 0 Answers
Tracking down a SIGABRT on startup 8 Answers