We keep seeing random crashes when using Unity APIs for iOS GameCenter. This happens very randomly, across various devices with iOS 11.2.x and 11.3.
It looks like a null pointer exception when it’s trying to call back after loading achievements.
This doesn’t seem to be an error in our app logic - the callback in game code is super simple, and works for most of sessions. Any ideas?
The game was built with Unity 2017.3.0p2 or 2017.4.1f1 LTS and XCode 9.2 on Unity Cloud Build. Crash logs:
0 . 0x0000000000000000 <unknown>
1 project 0x0000000105daf2e8 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
2 project 0x00000001057f66f8 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
3 project 0x00000001057fd288 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
4 project 0x000000010557afec InvokeGameCenterCallback(char const*, ScriptingArguments const&)
5 project 0x0000000105578ad0 void GameCenter::TriggerCallback<ScriptingObjectPtr, ScriptingArrayPtr>(char const*, ScriptingObjectPtr const&, ScriptingArrayPtr const&)
6 project 0x0000000105578730 __39+[AchievementWrapper loadAchievements:]_block_invoke
7 GameCenterFoundation 0x000000019e46acbc __39-[GKDispatchGroup notifyOnQueue:block:]_block_invoke.63
8 libdispatch.dylib 0x00000001834f0b24 _dispatch_call_block_and_release
9 libdispatch.dylib 0x00000001834f0ae4 _dispatch_client_callout
10 libdispatch.dylib 0x00000001834fd6e0 _dispatch_main_queue_callback_4CF$VARIANT$mp
11 CoreFoundation 0x0000000183ba7070 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
12 CoreFoundation 0x0000000183ba4bc8 __CFRunLoopRun
13 CoreFoundation 0x0000000183ac4da8 CFRunLoopRunSpecific
14 GraphicsServices 0x0000000185aa7020 GSEventRunModal
15 UIKit 0x000000018daa578c UIApplicationMain
16 project 0x0000000104a43650 main
17 libdyld.dylib 0x0000000183555fc0 start
(Edited to clarify the crash is after loading achievements specifically)