Few month ego, my google signIn procedure works without problem, but today the emulator reply me in the Logcat this error:
E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NEED_REMOTE_CONSENT. App: com_pro.bandweb.mycpstore, Service: oauth2:email https://www.googleapis.com/auth/spreadsheets.readonly openid profile
try to look in google but I not find any suggestion...this are the code that I use for sigIn:
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, "getting sign-on again");
//startActivityForResult(googleSignInClient.getSignInIntent(), RC_SIGN_IN);
SignInActivityResult.launch(googleSignInClient.getSignInIntent());
} else {
Log.v(TAG, "sign-on is still good, reusing");
//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), ""))
|| !(spreadsheetIdPattern.matcher(sharedPreferences.getString(getString(R.string.pref_googleSheetId_key), ""))).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<Intent> SignInActivityResult= registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
if(result.getResultCode() != RESULT_CANCELED) {
if (result.getResultCode() == Activity.RESULT_OK && null != result.getData())
{
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(result.getData());
handleSignInResult(task);
}
}else{
progressBar.setVisibility(ProgressBar.GONE);
}
}
});
I had the same issue on a Google Pixel 5 with Android 11.
2021-08-11 13:32:59.603 29917-30363/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NEED_REMOTE_CONSENT. App: de.aoksystems.ma.abp.app.internal, Service: oauth2:https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.heart_rate.read https://www.googleapis.com/auth/fitness.nutrition.read
But it works fine on a Samsung S10 with Android 11
4 Weeks ago it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With