0

I'm creating a game right now and try to implement Google Play Games SignIn. My Problem is that (i think so) Google Play Games isn't installed right on the VM. If i start the App it'll give me the response that "Google Play Games isn't installed" (see pics). If you click on the Install or Cancel Button it'll open the same screen a second time. I don't know why. No error is displayed.

Link to the Error Image

Here's the whole code connected to the LogIn System:

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "Connection Failed");

    if (mResolvingConnectionFailure) {
        // Already resolving
        return;
    }

    // If the sign in button was clicked or if auto sign-in is enabled,
    // launch the sign-in flow
    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;
        mResolvingConnectionFailure = true;

        // Attempt to resolve the connection failure using BaseGameUtils.
        // The R.string.signin_other_error value should reference a generic
        // error string in your strings.xml file, such as "There was
        // an issue with sign in, please try again later."
    if (!BaseGameUtils.resolveConnectionFailure(this,
                mGoogleApiClient, connectionResult,
                RC_SIGN_IN, getResources().getString(R.string.signin_other_error))) {
            mResolvingConnectionFailure = false;
        }
    }

    // Put code here to display the sign-in button
}

public void onGoogleClick(View view){
    mSignInClicked = true;
    mGoogleApiClient.connect();
}

@Override
public void onConnected(Bundle connectionHint) {
    // show sign-out button, hide the sign-in button
    findViewById(R.id.sign_in_button).setVisibility(View.GONE);
    Log.d(TAG, "Connected");
    Games.Achievements.unlock(mGoogleApiClient, getResources().getString(R.string.ach_lvl3));

    // (your code here: update UI, enable functionality that depends on sign in, etc)
}

@Override
public void onConnectionSuspended(int i) {
    Log.d(TAG, "Connection Suspended");
}

And the GoogleApiClient Declaration

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Games.API).addScope(Games.SCOPE_GAMES)
            .build();
Maxim Kopecki
  • 389
  • 4
  • 16

3 Answers3

0

Check out the Google Page on the topic

The short version:

  • Make certain Google APIs are updated in the AVD Manager
  • Choose "Google APIs x86 version NN" (NN being your target) for the AVD.

Fixed Maps for me a while back - with some other minor fiddling. The problem is that not every image has Play store and/or the particular Goog API installed, so they fail. Using the Google APIs ones makes certain both are present.

HTH

The_GM
  • 87
  • 2
  • I can just find Android Versions with the Google Play Apis includeded. Looks like their not updated but in my SDK Manager everything seems ok – Maxim Kopecki Jun 09 '16 at 05:18
0

Okay then, couple other ideas.

  1. In the "Android SDK Manager" reinstall the Google APIs (listed under extras). I don't expect that to resolve your problem, just covering bases.
  2. I have never tried it, but a lot of knowledgeable people recommend Genymotion as an alternative for debugging - though lately it sounds like Play services were removed from their AVDs, this says they're still supporting play.

Hope you get it going soon.

The_GM
  • 87
  • 2
0

Based on the attached image, the Google Play Service App might be outdated. You just need to update the app.

Go to Google Play and download Google Play services. Hope that helps.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56