Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Game center crash on simulator

This is driving me crazy, I just can't find out the problem:
I have a crash on game center on simulator, in the device it works perfect. 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've tried setting both deployment target and base sdk to 4.3 with no luck.
I've tried doing the call from application:didFinishLaunchingWithOptions: and also doing it later after the player clicks on the "play" button in the main screen. Both cases the same result.

Also, I get no stack trace; it looks like this:

0 objc_msgSend
1 < ???? >

I get a EXC_BAD_ACCESS.

Any idea will be appreciated.
Thanks

like image 282
Damian Avatar asked Jul 13 '11 11:07

Damian


1 Answers

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

I found other person with the same problem in a comment in this question: iOS 4 app crashes at startup on iOS 3.1.3: Symbol not found: __NSConcreteStackBlock

like image 91
Damian Avatar answered Oct 17 '22 09:10

Damian