我想在登录谷歌添加到我的科特林但我在“USER_ACCOUNT”得到错误。 它说:“类型不匹配:推断类型是GoogleSignInAccount但GoogleSignInAccount预期?”如何纠正这个错误?
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == RC_SIGN_IN) {
val task: Task<GoogleSignInAccount> = GoogleSignIn.getSignedInAccountFromIntent(data)
try {
val user_account = task.getResult(ApiException::class.java)
firebaseAuthWithGoogle(user_account)
} catch (e: ApiException) {
Toast.makeText(this, "Google sign in failed:(", Toast.LENGTH_LONG).show()
}
}
}