gpt4 book ai didi

java - Google 登录错误 12500 SHA1 双重检查 GoogleSignInAccount account =completedTask.getResult(ApiException.class);

转载 作者:行者123 更新时间:2023-12-02 10:36:01 35 4
gpt4 key购买 nike

我在选择 Google 帐户后收到此错误。 OnActivityResult 被调用,但在评估结果后抛出此错误。原因不是 SHA1 错误,我使用相同的 key 进行发布和调试。该应用程序不是来自 Google Play。我没有使用 firebase。 Google 登录示例使用相同的 key 。

com.google.android.gms.common.api.ApiException:12500:

堆栈跟踪:

W/System.err: com.google.android.gms.common.api.ApiException: 12500: 
W/System.err: at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source)
W/System.err: at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)
W/System.err: at de.org.limindo.limindo2.fragLogin.onActivityResult(fragLogin.java:412)
W/System.err: at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:151)
W/System.err: at de.org.limindo.limindo2.MainActivity.onActivityResult(MainActivity.java:788)
W/System.err: at android.app.Activity.dispatchActivityResult(Activity.java:5456)
W/System.err: at android.app.ActivityThread.deliverResults(ActivityThread.java:3549)
W/System.err: at android.app.ActivityThread.handleSendResult(ActivityThread.java:3596)
W/System.err: at android.app.ActivityThread.access$1300(ActivityThread.java:151)
W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1369)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:110)
W/System.err: at android.os.Looper.loop(Looper.java:193)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5299)
W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
W/System.err: at dalvik.system.NativeStart.main(Native Method)

代码是:

           GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleSignInClient = GoogleSignIn.getClient(fragLogin.this._main, gso);


mSignInGoogle0.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View view)
{
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, RC_SIGN_IN);

}
});

@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);
}
}


private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
try {
GoogleSignInAccount account = completedTask.getResult(ApiException.class);

// Signed in successfully, show authenticated UI.
if (account != null)
{
mPasswordView.setVisibility(View.GONE);
mPasswordView.setVisibility(View.GONE);
}
updateUI(account);
} catch (ApiException e) {
e.printStackTrace();
// The ApiException status code indicates the detailed failure reason.
// Please refer to the GoogleSignInStatusCodes class reference for more information.
Log.w(TAG, "signInResult:failed code=" + e.getStatusCode());
lib.ShowMessage(getContext(), getString(R.string.googleloginnotsuccessfull) + "\n" + getString(R.string.ErrorCode) + GoogleSignInStatusCodes.getStatusCodeString(e.getStatusCode()) + ":" + e.getStatusCode(), getString(R.string.Error));
updateUI(null);
}
}

最佳答案

如果这对任何人有帮助:我就处于这种情况,只是它最初有效,后来停止工作。我终于意识到这是因为我换了笔记本电脑。

关于java - Google 登录错误 12500 SHA1 双重检查 GoogleSignInAccount account =completedTask.getResult(ApiException.class);,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53287131/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com