【问题标题】:Error Code 12500 when trying to implement google sign in for android尝试为 android 实现 google 登录时出现错误代码 12500
【发布时间】:2023-09-13 20:18:01
【问题描述】:

所以我已经收到错误 12500 3 天了,我查看了所有可能的帖子以尝试解决错误。我更新了谷歌播放服务,更新了谷歌控制台以确保有支持链接并添加了个人资料图片。我没有使用 Firebase。我只是使用谷歌控制台。当我创建 GoogleSignInAccount 帐户时,似乎发生了错误。

@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(@NonNull Task<GoogleSignInAccount> completedTask) {
    try {
        GoogleSignInAccount account = completedTask.getResult(ApiException.class);
        String idToken = account.getIdToken();
        System.out.println(idToken);
        updateUI(account);
    } catch (Exception e) {
        e.printStackTrace();
        updateUI(null);
    }
}

W/System.err:com.google.android.gms.common.api.ApiException:12500: 在 com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(未知来源:4) 在 com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(未知来源:8) 在 edu.lehigh.cse216.phase0.ui.login.LoginActivity.onActivityResult(LoginActivity.java:90) 在 android.app.Activity.dispatchActivityResult(Activity.java:7454) 在 android.app.ActivityThread.deliverResults(ActivityThread.java:4353) 在 android.app.ActivityThread.handleSendResult(ActivityThread.java:4402) 在 android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) 在 android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) W/System.err:在 android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 在 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 在 android.os.Handler.dispatchMessage(Handler.java:106) 在 android.os.Looper.loop(Looper.java:193) 在 android.app.ActivityThread.main(ActivityThread.java:6669) 在 java.lang.reflect.Method.invoke(本机方法) W/System.err:在 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

【问题讨论】:

    标签: java android google-signin


    【解决方案1】:

    请关注Google Sign In error 12500,第二个请阅读google登录方法的最新文档。

    【讨论】:

      最近更新 更多