when you have some scrolling going on (be it table view, or keyboard scrolling for japaneese language, or your own scroll view)
here is a workaround.
in UnityAppController.mm look for repaintDisplayLink method, and comment out code like that:
Thanks for offering the solution, Alexey! It’s been a real witch hunt after this very strange crash. Before I’ll start updating my apps, what are the side effects for your fix? Will that affect touch event processing?
from my understanding (and some internal testing) there are no sideffects completely.
It was needed long ago when unity was run in default run loop, so we needed to give some time to other runloops (tracking, for touches/scrolling etc)
but then at some point we moved unity playr loop to be scheduled in “common” run loop (read: now it should be scheduled along with all events/messages/etc), so this is more or less just a leftover.
We use an automated build system to generate our XCode projects, and we are running into this crash. How can we fix UnityAppController.mm in this way?
Assets/Plugins/iOS code goes to Library, and if we put a duplicate of UnityAppController.mm in that folder, we (correctly) get errors about duplicated classes (as the real one is in Classes).
I tried subclassing and overriding repaintDisplayLink, but the rest of that functionality refers to private members and methods. I can’t call “super” without running into the original problem, and I can’t expose the private members and methods - if I could, I just would make the change directly.
Been trying to find the cause of this crash for a while now, it always seems to be very random and difficult for us to re-create in our testing (seems to trigger when we launch native dialogs but not all the time).
Testing out this workaround at the moment to see if it seems to solve the issue.
Is this a bug within unity? and if so has a bug report been made? Or are we all just missing something when opening dialogs or other native things over unity?
UPDATE 1: This workaround has not worked for us, I’m still seeing the crash (currently testing on iOS6.2 on an iPad3). Does anyone else have any idea what is causing this / potential fixes?
UPDATE 2: It actually seems like this workaround made the issue worse in our case. Before I was noticing the crash occasionally when launching the app, now however with the workaround It crashes without fail every time we launch.
If you’re using Automated build systems, your best bet is probably using PostprocessBuildPlayer scripts to modify the XCode project after its built. You should be able to write a script that just grabs the UnityAppController.mm searches for the relevant code and comments it out.