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
1
Question by Kiloblargh · Sep 29, 2012 at 05:23 PM · ioscrashxcode

How do I track down an unspecified System.NullReferenceException?

That only shows up when I'm running on the device (iOS), and not in the editor? I'm getting an occasional (the worst kind) crash, upon returning to the game's main menu, and in the xCode output there's this...

 **Unhandled Exception: System.NullReferenceException:** 

...and that's all she wrote. If I could get it to happen when I'm previewing it in Unity it would tell me what caused the error, or if xCode barfed up its usual screenful of calls with the offending line highlighted, I could get this fixed, but right now it's a mystery. Before the error in the output, I've got this:

 Unloading 1 unused Assets to reduce memory usage. Loaded Objects now: 29976. Operation took 850.822998 ms.
 GameCenter logged in

 Running LoadPrefsForOptionsScreen
  
 (Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
 
 2012-09-29 09:50:10.738 fourdsnake[1549:907] no Facebook session available

From that I'm guessing it is something with my prefs and connecting to Facebook, but the Facebook stuff is Prime31's and my prefs handling is kind of a mess so that doesn't help.

Can I force xCode to give me more detailed error messages in this case?

Comment
Add comment · Show 4
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
avatar image whydoidoit · Sep 29, 2012 at 05:24 PM 0
Share

There's usually a stack trace/threads window you can open that you can then look through to give you more of a hint of where to look.

avatar image Kiloblargh · Sep 29, 2012 at 06:12 PM 0
Share

There should be in the left pane but as soon as it gets that NullReferenceException the app quits and the debug pane goes gray with "No Debug Session".

avatar image Kiloblargh · Sep 29, 2012 at 07:08 PM 0
Share

That in itself could be diagnostic if I knew what it meant, because I don't think that's normal behavior- usually NullReferenceExceptions result in a freeze, and only out of memory errors cause it to quit unexpectedly.

avatar image Mortennobel · Apr 10, 2013 at 07:41 AM 0
Share

I'm having the same issue - did you ever find a solution or a reason for the crash?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Mortennobel · Apr 10, 2013 at 07:58 AM

I was able to track down my issue by changing Script Call Optimization from 'Fast but no exceptions' to 'Slow and safe' in the players settings.

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

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

iOS Xcode Error: Thread 1: EXC_BREAKPOINT 0 Answers

iOS game freezes on startup 0 Answers

Failed to load AOT module ... in aot-only mode. 1 Answer

IOS Build works on iPod but not on iPhone?! 2 Answers

Cannot start game on IPAD - EXC_BAD_ACCESS 2 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