- Home /
Help debugging crash on iOS EXC_BAD_ACCESS
Hi,
I know this was asked a lot with different causes. I have read all that I could find on the subject, but I am still stuck - so any help would be greatly appreciated.
Here is the story:
Upgraded Unity from 3.5.7 to 4.2.
Successfully upgraded my project (all the
SetActive
stuff mostly)The project runs in the Editor, no errors.
The project used to run with Unity 3.5.7 on the device with no problems.
I am now getting a crash with
EXC_BAD_ACCESS
when I load my third scene.I have enabled NSZombies in Xcode to try and better understand whats going on, its still cryptic for me.
I have tried attaching MonoDevelop debugger, but I didn't see anything I can use (I am not usually using MonoDevelop so I could be missing some debug technique).
The exact same thing happened to me with another project, when upgraded to an older Unity 4 version (and this was the reason I avoided upgrading for so long).
UPDATE: Managed to get it to not crash in the simulator, still crashing on the device.
UPDATE: I have created an "export package" for my entire project, and reloaded it into a new blank project. At first, it seemed to be working, but then I realized it still crashes, only at a different place now...
UPDATE: I since managed to eliminate the crash, it is caused by a bug in Unity 4.2 where DewviceID is not retained. I have learned it from this forum thread, and I am waiting for either Unity support or a more advanced user to post an authoritative fix for us to implement in the DeviceSettings.mm file (for DeviceID, VendorID, and ADID)
Finally, here are two screenshots: One, without NSZombies (generating EXC_BAD_ACCESS
) and one with NSZombies (generating EXC_BREAKPOINT
- needless to say, I did not place any breakpoint...)
Without NSZombies:
With NSZombies:
Have you modified the XCode project at all? If you have, did you make sure to do a build and replace when building from Unity to push the updated h / m files to XCode.
I could be mistaken, but the errors are being shown directly in your XCode console. Unrecognized selector sent to instance is stating that you're sending a method call ( i.e. selector ) to an object instance that does not have an implementation for that specific signature / selector.
$$anonymous$$essage sent to deallocated instance should be an obvious error. Something has been released and you're still trying to call methods on it.
Thanks for commenting. I have spent the entire day yesterday in trying to figure it out, and the process involved replacing the Xcode build several times, as well as refreshing the Unity Library folder by deleting it and letting Unity rebuild from meta files. Still no luck.
I did not change anything in Xcode, and the reported error does not tell me anything, thats exactly my point... :)
$$anonymous$$y code works in the editor, it worked on the device in Unity 3.5, and since I do not have device specific code, I expect it to work on the device just the same. Something in Unity 4 changed and I have no idea how to debug it.
Answer by DannyB · Sep 03, 2013 at 01:35 PM
Ok,
So as it turns out, this particular crash was caused by a bug in Unity 4.2, as discussed in this forum thread.
After retaining the _DeviceID, all worked smoothly, and as it seems from the changelog, Unity 4.2.1 fixes this bug.
Your answer
Follow this Question
Related Questions
GpuProgramsMetal.mm Crashing on iOS 1 Answer
Unity iOS Crashes Every Other Launch 0 Answers
Unity 5.5.0f3 IOS Crash After Screen Sleep 3 Answers
Native Crash - ___ZN19HTTPConnectionCache11enableTimerEv_block_invoke (Unknown File) 0 Answers
How do you make IOS storyboard launch screens work? 0 Answers