0
Google sign-inを使用しようとするとcom.google.android.gms.common.api.ApiException: 10:
が届きます。ここでAndroidでGoogleログインを使用しているときにわかりにくいエラーが発生する
は、コードそのものです:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
// The Task returned from this call is always completed, no need to attach
// a listener.
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
//handleSignInResult(task);
GoogleSignInAccount account = getAccount(task);
System.out.println("asti00");
}
}
public GoogleSignInAccount getAccount(Task<GoogleSignInAccount> task) {
GoogleSignInAccount account = null;
try {
account = task.getResult(ApiException.class);
} catch (ApiException ex) {
// TODO: handle exception
System.out.println("asti01");
System.out.println("MESSAGE: " + ex.getMessage());
ex.printStackTrace();
System.out.println("asti02");
}
return account;
}
あなたは、私がtutorialのように正確なコードを使用していますが、私はエラーcom.google.android.gms.common.api.ApiException: 10:
を取得しています見ることができるように。
どこからエラーが発生しているのかわかりません。誰でも助けてくれますか?
おかげ
lvanovチェックgithubのリンクhttps://github.com/googlesamples/google-services.git –