Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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.

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 Store Rejection - Crashes 2 Answers

Unity 4.2 IOS Exception Handling 0 Answers

iOS game freezes on startup 0 Answers

Unity 5.5.0f3 IOS Crash After Screen Sleep 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges