Flutter firebase auth 抛出平台异常没有被 try catch

问题描述

我遇到了这个问题,我不知道为什么。我在 firebase 上设置了所有内容,当您正确输入用户名/密码时,一切都可以正常进行注册登录。但是,当尝试捕获错误时,我收到了一个平台异常并且它的形式很奇怪。 (这是我在尝试错误的密码)。如您所见,平台异常中的平台异常中有 Firebaseauhexception,而我的 try catch 甚至无法捕获它。我更新到最新版本的 ^1.1.1

PlatformException (PlatformException(firebase_auth,com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The password is invalid or the user does not have a password.,{code: wrong-password,additionalData: {},message: The password is invalid or the user does not have a password.},null))
try {
    userCredential = await FirebaseAuth.instance.signInWithEmailAndPassword(email: user,password: pass);
  } on FirebaseAuthException catch (e) {
    if (e.code == 'user-not-found') {
      print('No user found for that email.');
    } else if (e.code == 'wrong-password') {
      print('Wrong password provided for that user.');
    }
  }

更新我也得到这个显示

Ignoring header X-Firebase-Locale because its value was null.

更新 2 找到了这个链接,它描述了我有类似的东西 Google Sign-In With Flutter: Error Code -4

任何见解将不胜感激

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...