Recently I had a problem with Unity not running and got help from this thread.
After deleting all unity files in my /Library folder, Unity start as new and my game played generally behaved normally in Unity. I suppose this whole thing has something to do with my new problem which occurred just after this 1st (and solved) problem:
When I build, I get a EXC_BAD_ACCESS error in XCode.
The game plays just fine on the device (iPhone 3gs) though.
Following, are snapshots of the XCode Debugger Console window and of my player settings:
(to see the DebuggerConsole image, you may have to open it in a new tab or download it and open it)
I don’t know if this happens because I deleted files I shouldn’t have from /Library folder or because my Player Settings are incorrect. I don’t remember which are the correct ones.
I tried deleting the /Developer/Platforms/iPhoneOS.platform/DeviceSupport//4.3.3 folder and letting XCode recollect symbols from my device but that didn’t help.
Also, I’d like to note that building with SDK Version set to iOS simulator 4.2 gave no errors.
Thanks for the quick reply dreamora, but I am using XCode 3.2.5. (isn’t this SDK 4.2?) In the meantime I tried building another game I’m making and it was built and ran without problems, so I’m guessing the problem is game-specific and doesn’t have to do with the sdk version.
In both cases (the one that gives me the error and the other that builds fine) I used:
SDK Version: iOS 4.2
Target iOS Version: 3.0
I searched the Forum for threads regarding this error and dreamora’s comment here that "EXC_BAD_ACCESS is normally the xcode / gdb answer on something that would throw a NullReferenceException inside of Unity." I looked for “empty” variable fields in the Inspector (there where 6) and “filled” them. The problem got solved and the game builds error-free.
Though keep in mind that the appstore rejection problem with the iOS 4.3 SDK still remains. It will work more or less fine on your device, but will fail for apple on their end and get rejected.
In case you are interested in finding out generally where such errors happen: If you have a debug build and run in debug inside XCode, you get a callstack that tells you the function causing it. (if you attach the mono debugger you get even more accurate informations - potentially at least)
Yes, I’m aware of the 4.3-appstore-rejection issue (hopefully it will be solved in a Unity update). And thanks for the debug build tip (I had already read an older post of yours where you pointed that out - hehe!)