title: Android Google+ login doesn't work - statusCode=SIGN_IN_REQUIRED
body: <p>I'm trying to let the user login with Google+. I have created the project in the Google developer console, I got the Client ID and I have installed the Google play services in Android Studio. (My running device has Android 4.4.2)
  When the app is running and I press the login button a toast message appears: 
  "Internal Error"</p>
  
  <p>The error in the Logcat is the following:</p>
  
  <pre><code>error ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{429ffe38: android.os.BinderProxy@429ffdd8}}
  </code></pre>
  
  <p>Notice that this error appears before that the user has pressed the button, in fact, through debugging, I figured out it comes from this line code: </p>
  
  <pre><code>Log.e(TAG, "error " + result.toString());
  </code></pre>
  
  <p>which is in the method:</p>
  
  <pre><code>public void onConnectionFailed(ConnectionResult result) {
      if (!mGoogleIntentInProgress) {
          /* Store the ConnectionResult so that we can use it later when the user clicks on the Google+ login button */
          mGoogleConnectionResult = result;
  
          if (mGoogleLoginClicked) {
              /* The user has already clicked login so we attempt to resolve all errors until the user is signed in,
               * or they cancel. */
              resolveSignInError();
          } else {
              Log.e(TAG, "error " + result.toString());
          }
      }
  }
  </code></pre>
  
  <p>Here the other important methods:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login);
      SignInButton googleLoginButton = (SignInButton) findViewById(R.id.login_with_google);
      googleLoginButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              mGoogleLoginClicked = true;
              if (!mGoogleApiClient.isConnecting()) {
                  if (mGoogleConnectionResult != null) {
                      resolveSignInError();
                  } else if (mGoogleApiClient.isConnected()) {
                      getGoogleOAuthTokenAndLogin();
                  } else {
                  /* connect API now */
                      Log.d(TAG, "Trying to connect to Google API");
                      mGoogleApiClient.connect();
                  }
              }
          }
  
      });
  
      /* Setup the Google API object to allow Google+ logins */
      mGoogleApiClient = new GoogleApiClient.Builder(this)
              .addConnectionCallbacks(this)
              .addOnConnectionFailedListener(this)
              .addApi(Plus.API)
              .addScope(Plus.SCOPE_PLUS_LOGIN)
              .build();
  }
  
   private void resolveSignInError() {
      if (mGoogleConnectionResult.hasResolution()) {
          try {
              mGoogleIntentInProgress = true;
              mGoogleConnectionResult.startResolutionForResult(this, RC_GOOGLE_LOGIN);
          } catch (IntentSender.SendIntentException e) {
              // The intent was canceled before it was sent.  Return to the default
              // state and attempt to connect to get an updated ConnectionResult.
              mGoogleIntentInProgress = false;
              mGoogleApiClient.connect();
          }
      }
  }
  
   @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (requestCode == RC_GOOGLE_LOGIN) {
          /* This was a request by the Google API */
          if (resultCode != RESULT_OK) {
              mGoogleLoginClicked = false;
          }
          mGoogleIntentInProgress = false;
          if (!mGoogleApiClient.isConnecting()) {
              mGoogleApiClient.connect();
          }
      }
  
  
  }
  </code></pre>
  
  <p>Here the code in the AndroidManifest.xml</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.USE_CREDENTIALS" /&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  </code></pre>
  
  <p>And the meta-data </p>
  
  <pre><code>   &lt;meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" /&gt;
  </code></pre>
  
  <p>Hope you can help me, thanks a lot! </p>