断言失败:第38行pos 12:' displayName!= null':不是真的

时间:2018-04-27 11:58:26

标签: android firebase firebase-authentication flutter flutter-dependencies

Firebase Flutter登录获取错误

  

04-28 14:31:21.261 7687-8012 / com.companyname.firebaselogin I / flutter:' package:google_sign_in / google_sign_in.dart':失败的断言:第38行:' displayName != null':不是真的。

使用相同的文档代码 -

Future<FirebaseUser> _handleSignIn() async {
final GoogleSignIn _googleSignIn = new GoogleSignIn();
GoogleSignInAccount googleUser = await _googleSignIn.signIn();

GoogleSignInAuthentication googleAuth = await googleUser.authentication;
FirebaseUser user = await _auth.signInWithGoogle(
  accessToken: googleAuth.accessToken,
  idToken: googleAuth.idToken,
);
print("signed in " + user.displayName);
return user;
}
  

firebase_auth:&#34; ^ 0.5.5&#34;

     

google_sign_in:&#34; ^ 3.0.2&#34;

0 个答案:

没有答案