title: Google SignIn error getToken() -> NEED_REMOTE_CONSENT
body: <p>Few month ego, my google signIn procedure works without problem, but today the emulator reply me in the Logcat this error:</p>
  <p><strong>E/Auth: [GoogleAccountDataServiceImpl] getToken() -&gt; NEED_REMOTE_CONSENT. App: com_pro.bandweb.mycpstore, Service: oauth2:email <a href="https://www.googleapis.com/auth/spreadsheets.readonly" rel="noreferrer">https://www.googleapis.com/auth/spreadsheets.readonly</a> openid profile</strong></p>
  <p>try to look in google but I not find any suggestion...this are the code that I use for sigIn:</p>
  <pre><code>public void InitGoogle() throws IOException {
          GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                  .requestScopes(new Scope(SPREADSHEETS_SCOPE))
                  .requestEmail()
                  .build();
          googleSignInClient = com.google.android.gms.auth.api.signin.GoogleSignIn.getClient(this, gso);
  
          if (GoogleSignIn.getLastSignedInAccount(this) == null) {
              Log.v(TAG, &quot;getting sign-on again&quot;);
              //startActivityForResult(googleSignInClient.getSignInIntent(), RC_SIGN_IN);
              SignInActivityResult.launch(googleSignInClient.getSignInIntent());
          } else {
              Log.v(TAG, &quot;sign-on is still good, reusing&quot;);
  
              //faccio la richiesta solo se è stato inserito il foglio di google shhet nelle preferenze, altrimenti avviso
              SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
              if (!sharedPreferences.contains(getString(R.string.pref_googleSheetId_key))
                      || StringUtils.isBlank(sharedPreferences.getString(getString(R.string.pref_googleSheetId_key), &quot;&quot;))
                      || !(spreadsheetIdPattern.matcher(sharedPreferences.getString(getString(R.string.pref_googleSheetId_key), &quot;&quot;))).find()) {
                  // no Google sheet ID has been specified - can't retrieve ingredients
                  progressBar.setVisibility(ProgressBar.GONE);
                  Toasty.info(this, getString(R.string.missing_pref_id_sheet_title), Toasty.LENGTH_LONG, true).show();
              }else {
                  //scelgo il tipo di sincronizzazione quando inizializzo il tablet, in base alla scelta nelle preferenze
                  if(AppSettings.get().getSyncModeOnStartup() == UPLOAD_DATI)
                      synchGoogleSheet(UPLOAD_DATI);
                  else if(AppSettings.get().getSyncModeOnStartup() == DOWNLOAD_DATI)
                      synchGoogleSheet(DOWNLOAD_DATI);
                  else
                      synchGoogleSheet(UPLOAD_DOWNLOAD_NONE);
              }
          }
          progressBar.setVisibility(ProgressBar.GONE);
  
  ..
  ..
  ..
  ..
  
  
  
  
  
  ActivityResultLauncher&lt;Intent&gt; SignInActivityResult= registerForActivityResult(
          new ActivityResultContracts.StartActivityForResult(),
          new ActivityResultCallback&lt;ActivityResult&gt;() {
              @Override
              public void onActivityResult(ActivityResult result) {
                  if(result.getResultCode() != RESULT_CANCELED) {
                      if (result.getResultCode() == Activity.RESULT_OK &amp;&amp; null != result.getData())
                      {
                          Task&lt;GoogleSignInAccount&gt; task = GoogleSignIn.getSignedInAccountFromIntent(result.getData());
                          handleSignInResult(task);
                      }
                  }else{
                      progressBar.setVisibility(ProgressBar.GONE);
                  }
              }
          });
  </code></pre>