• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps real-time multiplayer api conenction failed

Im trying to add multiplayer to my game, but every time i try to invite others i get this error in my "onConnectionFailed" method which are called whenever there is no connection to Google play services. However i cant see to find much usefull information about this error, other than it MIGHT have to do with SHA1 certificat or recognization of my Google play service account. However i did already check that the package id is the same on my account and in the project so no problem there, i got my SHA1 from my console and added that to my gps account, not sure if im supposed to add it in my project somewhere aswell? Any tips will be appreciated!

anyhow the error:
onConnectionFailed:ConnectionResult{statusCode=RESOLUTION_REQUIRED, resolution=PendingIntent{154e98aa: android.os.BinderProxy@276fc9b}, message=null}

Before onConnectionFailed is called this happend when i press invitePlayer button from my menu, it allways goes to the else part of my loop and to onConnectionFailed:

Java:
   public void invitePlayerClicked(View view)                 
    {
          // if mGoogleApiClient is connected
        if(mGoogleApiClient.isConnected())
        {
            Intent intent = Games.RealTimeMultiplayer.getSelectOpponentsIntent(mGoogleApiClient, 1, 3);
            startActivityForResult(intent, RC_SELECT_PLAYERS);
        }
        else
        {
            //connect it
            mGoogleApiClient.connect();
            mGoogleApiClient.connect(GoogleApiClient.SIGN_IN_MODE_REQUIRED);
            Log.d("Action: ", "failed to connect.." );
        }
    }

Thanks in advance!
Kasper
 
Hi,
I moved your thread to the development area where folks that are likely able to help will see it. :)

I also put your code inside of code tags as it makes it more readable. Good luck.
 
Are you following the instructions in the dev guide?

public static final int RESOLUTION_REQUIRED


Completing the connection requires some form of resolution. A resolution will be available to be started with startResolutionForResult(Activity, int). If the result returned is RESULT_OK, then further attempts to connect should either complete or continue on to the next issue that needs to be resolved.

https://developers.google.com/andro...mon/ConnectionResult.html#RESOLUTION_REQUIRED

See also:

https://developers.google.com/android/reference/com/google/android/gms/location/SettingsApi
 
Are you following the instructions in the dev guide?
Yeah i am following that guide, however i feel like its not the best thing ever as sometimes its using the same code for different things, and it can be confusiing if its working on a gameroom or just a lobby/waiting room. Also it lacked some things that i had to find myself from projects on github. However i yesterday got an update for Android studio and now i dont have this error anymore, instead when i try to GoogleApiClient.connect my application instantly crashes, and it claims that i need to update my google play services, but when i check under tools-->android --> sdk --> update tools there are no updates for google play services, aka i should already have the newest one?

Is it possible to update google play services any other way than this?

This picture shows my log asking for a newer google play service but i got it fully updated in sdk window.
http://tinypic.com/r/69i04g/9
 
Back
Top Bottom