我正在尝试在 Android 中为 Google Drive 使用 AccountManager 获取身份验证令牌:
String AUTH_TOKEN_TYPE = "oauth2:https://www.googleapis.com/auth/drive";
GoogleAccountManager accountManager = credential.getGoogleAccountManager();
accountManager.getAccountManager().getAuthToken(
credential.getSelectedAccount(), // Account retrieved using getAccountsByType("com.google")
AUTH_TOKEN_TYPE, // Auth Token Type
null, // Authenticator-specific options
this, // Your activity
new OnTokenAcquired(), // Callback called when a token is successfully acquired
new Handler(new OnAuthTokenError())); // Callback called if an error occurs
我从 logcat 得到错误代码:
01-07 11:03:13.454 I/GLSUser ( 4608): GLS error: **INVALID_LANGUAGE** xxxx@gmail.com oauth2:https://www.googleapis.com/auth/drive
01-07 11:03:13.454 V/GoogleLoginService( 4608): Returning error intent with: ComponentInfo{com.google.android.gsf.login/com.google.android.gsf.login.LoginActivity}
我不太明白为什么它在这里显示“INVALID_LANGUAGE”,有人有想法吗?谢谢。