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.
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();