• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by jasontanlee23 · Nov 05, 2014 at 11:53 AM · ioscrashreport

Crash Reporter for IOS not working.

 static void UncaughtExceptionHandler(NSException *exception) {
     NSLog(@"Uncaught exception: %@: %@\n%@", [exception name], [exception reason], [exception callStackSymbols]);
     if (gsCrashReporterUEHandler)
         gsCrashReporterUEHandler(exception);
 }
 
 
 static void InitObjCUEHandler()
 {
     // Crash reporter sets its own handler, so we have to save it and call it manually
     gsCrashReporterUEHandler = NSGetUncaughtExceptionHandler();
     NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
 }
 
 
 void InitCrashHandling()
 {
 #if ENABLE_CUSTOM_CRASH_REPORTER
     InitCrashReporter();
 #endif
 
 #if ENABLE_OBJC_UNCAUGHT_EXCEPTION_HANDLER
     InitObjCUEHandler();
 #endif
 }
 
 // This function will be called when AppDomain.CurrentDomain.UnhandledException event is triggered.
 // When running on device the app will do a hard crash and it will generate a crash log.
 void CrashedCheckBellowForHintsWhy()
 {
 #if ENABLE_CRASH_REPORT_SUBMISSION
     // Wait if app has crashed before we were able to submit an older pending crash report. This
     // could happen if app crashes at startup.
     WaitWhileCrashReportsAreSent();
 #endif
     
 #if ENABLE_IOS_CRASH_REPORTING || ENABLE_CUSTOM_CRASH_REPORTER
     
     // Make app crash hard here
     __builtin_trap();
     
     // Just in case above doesn't work
     abort();
     
 #endif
 }

Above is a piece of code from my crashreporter.mm

 #define ENABLE_IOS_CRASH_REPORTING 1
 #define ENABLE_OBJC_UNCAUGHT_EXCEPTION_HANDLER 1
 #define ENABLE_CUSTOM_CRASH_REPORTER 1
 #define ENABLE_CRASH_REPORT_SUBMISSION 0

 #if ENABLE_CRASH_REPORT_SUBMISSION && !ENABLE_CUSTOM_CRASH_REPORTER
     #undef ENABLE_CUSTOM_CRASH_REPORTER
     #define ENABLE_CUSTOM_CRASH_REPORTER 1
 #endif

Above is whats on my crashreporter.h

Player Settings -> Script Optimization = Fast but no exception

I'm using Unity Pro

When i force a crash on unity and check my CrashReport.reports on unity i dont get any report. i also put a breakpoint on xcode crashreporter.mm -> UncaughtExceptionHandler (), it doesn't go there whenever there is a crash. crashreporter.mm -> CrashedCheckBellowForHintsWhy () is the only function called inside crashreporter.mm when a crash happens.

Please help me on how i could make crash reporter work. I've done various work around to get my game's unhandled exception info but nothing works unless i set script optimization to Slow but safe and use Application.RegisterLogCallBack instead but that would mean sacrificing performance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TamaHobbit · Jan 15, 2016 at 05:45 PM

Did you check what's in Player settings under iOS for "Debugging and crash reporting"? There's a little documentation about what that does here, but it seems that the old way of subscribing to Application.logMessageReceived to handle C# exceptions is broken on iOS as of Unity 5 - The release notes say "New bugreporter", so you'll have to learn how to use that, it seems.

http://docs.unity3d.com/Manual/class-PlayerSettingsiOS.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Crash report xcode organizer symbol 1 Answer

App crashes as soon as splash screen is displayed(even just camera). 1 Answer

iOS Xcode Error: Thread 1: EXC_BREAKPOINT 0 Answers

iOS9 UnityAdBanner Crash 1 Answer

iOS crash on load: Terminated due to memory issue (Unity5.2.1p3) 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges