我正在尝试通过我的Android应用使用Flutter与Google登录, 但是当我按下登录按钮时出现此错误。
final FirebaseAuth _auth = FirebaseAuth.instance;
final GoogleSignIn _googleSignIn = new GoogleSignIn();
Future<FirebaseUser> _handleSignIn() async {
GoogleSignInAccount googleUser = await _googleSignIn.signIn();
GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
final FirebaseUser user =
(await _auth.signInWithCredential(credential)).user;
print("signed in " + user.displayName);
return user;
}
我在这里调用此函数...
onPressed: () => _handleSignIn()
.then(
(FirebaseUser user) => print(user),
)
.catchError(
(e) => print(e),
)),