android 缺少功能{名称=auth_api_credentials_开始_sign_in,版本=7}

myzjeezk  于 2022-11-27  发布在  Android
关注(0)|答案(1)|浏览(740)

我使用谷歌一键登录,并得到以下登录失败的消息:
缺少功能{名称=auth_api_credentials_开始_sign_in,版本=7}
不知道怎么了?
始终失败于:

.addOnFailureListener { beginSignInException ->
                        oneTapClient.beginSignIn(signUpRequest)
                            .addOnSuccessListener(
                                requireActivity()
                            ) { beginSignUpResult ->
                                IntentSenderRequest.Builder(beginSignUpResult.pendingIntent).build()
                                    .also { intentSenderRequest ->
                                        intentSenderRequestActivityResultLauncher.launch(
                                            intentSenderRequest
                                        )
                                    }
                            }
                            .addOnFailureListener { beginSignUpException ->
                                Log.d(
                                    TAG,
                                    "Google sign up failed:onResume: ${beginSignUpException.localizedMessage}"

                                )
                                Toast.makeText(
                                    requireContext(),
                                    "Google sign up failed:${beginSignUpException.localizedMessage}",
                                    Toast.LENGTH_SHORT
                                ).show()
                            }
                        Log.d(
                            TAG,
                            "Google sign in failed:onResume: ${beginSignInException.localizedMessage}"
                        )
                        Toast.makeText(
                            requireContext(),
                            "Google sign in failed:${beginSignInException.localizedMessage}",
                            Toast.LENGTH_SHORT
                        ).show()
                    }

完整代码:
第一次

vzgqcmou

vzgqcmou1#

https://developers.google.com/identity/sign-in/android/sign-in-identity
在我修改了下面的代码,并将setServerClientId()从移动的OAuth 2.0客户端ID修改为Web应用程序OAuth 2.0客户端ID后,解决了这个问题,可以成功登录注销。
第一个

相关问题