Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Get started (sign in) question? #6

Closed
yhuiyang opened this issue Jul 29, 2015 · 3 comments
Closed

Get started (sign in) question? #6

yhuiyang opened this issue Jul 29, 2015 · 3 comments
Labels
obsolete The associated code sample is now obsolete

Comments

@yhuiyang
Copy link

I am trying to integrate google play game services c++ sdk to my cocos2d-x game, but I failed.
So, I try to run sample NativeGame, but it failed too. (app crashes with same exception)

My test environment:

  • Xcode 6.4
  • iOS simulator - iphone6 (ios v8.4)
  • Google+ iOS sdk v1.7.1
  • Google Play Game Services C++ sdk v1.4.1

I am following steps in this get started guide https://developers.google.com/games/services/cpp/gettingStartedIOS

  • Open NativeGame.xcodeproj
  • Drag and drop google+ ios sdk and play game service c++ sdk to project's Frameworks folder.
  • Create game in google play developer console. This get my oauth2 client id and bundle id.
  • Setup bundle id in project. This id match the id setup in google play developer console.
  • And edit the code, ViewController.mm, to modify variables GPG_CLIENTID, GPG_ACHIEVEMENTID, and GPG_LEADERBOARDID to real value.

When I run NativeGame, click the on screen 'Sign in', app crashes with the following message.

2015-07-30 00:21:38.982 NativeGame[69604:5613222] StartAuthorizationUI
2015-07-30 00:21:39.006 NativeGame[69604:5613325] INFO: Auth operation started: SIGN IN
2015-07-30 00:21:39.024 NativeGame[69604:5613222] -[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x7f801b593540
2015-07-30 00:21:39.031 NativeGame[69604:5613222] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM gtm_httpArgumentsString]: unrecognized selector sent to instance 0x7f801b593540'
*** First throw call stack:
(
0   CoreFoundation                      0x0000000106045c65 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000105c1ebb7 objc_exception_throw + 45
2   CoreFoundation                      0x000000010604d0ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3   CoreFoundation                      0x0000000105fa313c ___forwarding___ + 988
4   CoreFoundation                      0x0000000105fa2cd8 _CF_forwarding_prep_0 + 120
5   NativeGame                          0x0000000102d4c693 -[GPPSignIn oauth2URLWithParams:] + 616
6   NativeGame                          0x0000000102d4c78e -[GPPSignIn doOAuthLoginWithParams:] + 109
7   NativeGame                          0x0000000102d4ce24 -[GPPSignIn authenticateInteractivelyWithParams:] + 77
8   NativeGame                          0x0000000102d4d041 -[GPPSignIn authenticateMaybeInteractively:withParams:] + 528
9   libdispatch.dylib                   0x000000010780f614 _dispatch_client_callout + 8
10  libdispatch.dylib                   0x00000001077fa2fa _dispatch_barrier_sync_f_slow_invoke + 275
11  libdispatch.dylib                   0x000000010780f614 _dispatch_client_callout + 8
12  libdispatch.dylib                   0x00000001077f7a1c _dispatch_main_queue_callback_4CF + 1664
13  CoreFoundation                      0x0000000105fad1f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
14  CoreFoundation                      0x0000000105f6edcb __CFRunLoopRun + 2043
15  CoreFoundation                      0x0000000105f6e366 CFRunLoopRunSpecific + 470
16  GraphicsServices                    0x0000000107bd1a3e GSEventRunModal + 161
17  UIKit                               0x000000010444c8c0 UIApplicationMain + 1282
18  NativeGame                          0x0000000102702adf main + 111
19  libdyld.dylib                       0x0000000107843145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

What's wrong with my steps?
I am not yet to be asked using which google test account to sign in, no consent screen displayed, and there is no google+ app in the simulator. Does this matter? I do not have real ios device to verify currently.

@ToddKerpelman
Copy link

I'd check two things:

  1. Did you remember to add the GoogleOpenSource.framework to your project?
  2. Did you try adding "-ObjC" to Build Settings > Linking > Other Linker Flags in Xcode?

@yhuiyang
Copy link
Author

I didn't add your check item 2, after add '-ObjC' linker flag, sample NativeGame sign in function is working. Thank you very much!

@ToddKerpelman
Copy link

You're welcome! That step seems to be missing in the C++ documentation -- I'll ask the team to fix it.

@dturner dturner added the obsolete The associated code sample is now obsolete label Sep 10, 2019
@dturner dturner closed this as completed Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
obsolete The associated code sample is now obsolete
Projects
None yet
Development

No branches or pull requests

3 participants