IOS: crash of the game center on the simulator

This drives me crazy, I just can't find the problem:
I have a crash in the game center on the simulator, it works fine in the device. It crashes when I call the following code:

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { if (error) { NSLog(@"An error occured authenticating the local game center player"); NSLog(@"Error: %@", [error localizedDescription]); } }]; 

I tried setting up both the deployment targets and the underlying sdk on 4.3 with no luck.
I tried to make a call from application:didFinishLaunchingWithOptions: and also do it later, after the player clicks the play button on the main screen. Both cases have the same result.

Also, I am not getting a stack trace; it looks like this:

 0 objc_msgSend 1 < ???? > 

I get EXC_BAD_ACCESS .

Any idea would be appreciated. Thanks

+6
source share
1 answer

The problem was that in the " Other Linker Flags " option in xcode, I had -weak_library /usr/lib/libSystem.B.dylib , changing this to -weak-lSystem , fixing the problem

I found another person with the same problem in a comment in this question: iOS 4 crash on launch on iOS 3.1.3: Character not found: __NSConcreteStackBlock

+7
source

Source: https://habr.com/ru/post/892671/


All Articles