Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BaseGameUtils Unknown Error, onConnectionFailed: result 4

I've already tested ButtonClicker 2000 example and it works great. Now I'm trying to implement Google Games Services into another game but it gives some error:

06-06 12:30:46.353: D/BaseGameActivity(7982): isGooglePlayServicesAvailable returned 0
06-06 12:30:46.353: D/BaseGameActivity(7982): beginUserInitiatedSignIn: starting new sign-in flow.
06-06 12:30:46.416: D/BaseGameActivity(7982): Connecting GamesClient.
06-06 12:30:46.424: D/BaseGameActivity(7982): onStart.
06-06 12:30:46.424: D/BaseGameActivity(7982): onStart: connecting clients.
06-06 12:30:46.424: D/BaseGameActivity(7982): Connecting GamesClient.
06-06 12:30:46.424: E/GmsClient(7982): Calling connect() while still connected, missing disconnect().
06-06 12:30:46.713: D/BaseGameActivity(7982): onConnectionFailed: result 4
06-06 12:30:46.713: D/BaseGameActivity(7982): onConnectionFailed: since user initiated sign-in, trying to resolve problem.
06-06 12:30:46.713: D/BaseGameActivity(7982): resolveConnectionResult: trying to resolve result: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{41692200: android.os.BinderProxy@416921a0}}
06-06 12:30:46.713: D/BaseGameActivity(7982): result has resolution. Starting it.

06-06 12:30:46.900: D/BaseGameActivity(7982): onActivityResult, req 9001 response 0
06-06 12:30:46.900: D/BaseGameActivity(7982): responseCode != RESULT_OK, so not reconnecting.
06-06 12:30:46.900: D/BaseGameActivity(7982): giveUp: giving up on connection. Status code: 4
06-06 12:30:46.900: D/BaseGameActivity(7982): Making error dialog for error: 4

com.google.android.gms logs the following error:

E/SignInActivity(7432): SignInActivity must be started with startActivityForResult

What I have done:

  • I've configured correctly the Developer console side. The SHA1 is correct (matches the androiddebug keystore).
  • In the API Console everything looks fine.
  • I've extended GameBaseActivity and implemented requested interfaces.
  • I have an ids.xml in values folder which matches the one in the Developer Console.
  • I have overriden requested methods, included onActivityResult()
  • The manifest is also OK, it includes the requested metadata.

  • This is the code I use to sign-in in onCreate:

    setSignInMessages("SIGNING IN", "SIGNING OUT");
    beginUserInitiatedSignIn();
    

When testing the example Button Clicker 2000 I had the Unknown Error too and fixed it configuring the dashboard correctly. The current game dashboard is also configured correctly, so I don't really know what's happening. What am I missing?

EDIT:

  • I also tried unwrapping BaseGameActivity and implementing GameHelper directly in my main Activity.
  • I tried publishing app games settings (because this game is already published on Play Store). Linked another app with my publishing signing SHA1 key. Setted as main app for installation. Still no luck.
like image 266
Angelo Tricarico Avatar asked Jun 06 '13 10:06

Angelo Tricarico


1 Answers

That's really strange. The error you've got, depending on your BaseGameActivity logs shouldn't happen.

SignInActivity is indeed not visible in the code, since you start it by calling GameHelper.resolveConnectionResult which will call mConnectionResult.startResolutionForResult(mActivity, RC_RESOLVE). That's mConnectionResult that has the Intent that will launch SignInActivity. And BaseGameActivity's logs are saying that you're starting it properly, so except if you've made some changes in BaseGameActivity and GameHelper, the error is strange.

Where are you looking for the errors? In your package filter? Really useful info are displayed in LogCat, but are not in your application filter. Look for all the messages with no filter, in LogCat, and search for the tags Volley and GameAgent. It may show you some errors.

One more thing: is the SignIn dialog showing nonetheless? When is the SignInActivity error is displayed (timestamp)?

like image 169
groug Avatar answered Nov 02 '22 22:11

groug