If I start my application with my wi-fi turned off, then hit "Home" and turn the wi-fi on, when I restart my app, it crashes 100% of the time. In Xcode Organizer, I can see the cause of the exception as "active assertions beyond permitted time".
I decided to set analytics to false based on the findings in this post:
This greatly improves things, but I still get the crash occasionally (around 10% to 20% of the time). But I know that turning analytics off definitely helped, since it's no longer 100%. Unfortunately, I also occasionally get KERN_INVALID_ADDRESS and KERN_PROTECTION_FAILURE crashes as a result of online/offline switching. My question is: what can I do to get these crashes to 0%?
This crash seems to usually be connected to analytics, so I have no idea what could be causing it once I set analytics to false. I tried setting UIApplicationExitsOnSuspend to both true and false, which didn't seem to make a difference.
If anyone else has tangled with this issue and has any input, I'd really appreciate it.
Can you post a full crash log? I am receiving similar errors with analytics disabled, but I'm not sure it's the same thing.
Here are the crash logs:
I've made an interesting discovery: setting analytics to false causes Ti.Platform.username to return garbage. Sometimes it will just be a nonsense string, other times it completely crashes the app, which explains the KERN exceptions I was getting.
I tried reproducing this in a small test project and couldn't, so there must be something else that is contributing to the issue as well. Are you accessing Ti.Platform data in your project by any chance?