After releasing a game on App Store we noticed some users reported crashing. It turns out it happens only when attemtping to log in to GameCenter. We are using some of the blueprints to gather data from GameCenter( uch as Read Friends) + some functionality to use the native GC window ( leaderboards, achievements). The tricky part is the crashes are not reproducible in sandbox - they only happen on live app and only to some users.
Unfortunately this is something of a sticky issue to try and reproduce because Game Center can sometimes be unreliable, and because your shipped user version can’t provide crash logs. Are you able to reproduce this crash with a development version on a device, at all?
That’s exactly the problem. We weren’t able to reproduce this issue on development version at all. Even if the store version would crash on the same device.
Try creating a test build of your game and seeing if that fails on the same device. A test build has limited logging and is very similar to the shipping build. If that doesn’t fail, then you can try a local build of the shipping and see if that fails. If so, then you can make calls to NSLog around the code which tries to access Game Center and potentially get some more information.
Hey, thanks for the answer. I misspoke in earlier reply. What i meant, is we tested shipping(and development) build on a device, but it still resulted in no crashes. The only difference between this one and one on App Store is that the App Store one is signed by apple so it has access to normal GameCenter, while everything you build locally is locked to Sandbox.
But i have one more question: did you get reports of GC crashes while using only your code/blueprints (such as ReadFriends)? I’m asking because we added a bit of our code, that acts similarly but gets more info from GC, and i’m trying to narrow the possibilities.
“Open in Project” took me to the line when the App Crashes.
Aha! I was reading the leaderboard that was nil and casting as Int !!!
After adding a if ( THIS != nil ) { } The App do not crash anymore
I notice that when there is not value on the leaderboard GameCenter says “Not ranked” meaning the value is nil