每当我试图通过将类型转换为"Firebase AuthException"从从task.getException()
接收的异常中获取errorCode时,它会给出错误,错误为java.lang.ClassCastException: com.google.firebase.FirebaseException cannot be cast to com.google.firebase.auth.FirebaseAuthException
,并且总是返回
GetMessage方法出现[INVALID_LOGIN_CREDICATIONS]错误
一百零二
以下是导致错误的代码.
String errorCode = ((FirebaseAuthException) task.getException()).getErrorCode();
个
我提供了无效的凭据只是为了获得例外,但我没有得到确切的例外,如如果密码是错误的,邮箱是不正确的,或用户找不到,等等.
我正在使用Android Studio Giraffe,2022.3.1 Patch 2
下面是我正在使用的依赖项
implementation("com.google.firebase:firebase-auth:22.1.2")
implementation("com.google.firebase:firebase-database:20.2.2")
implementation("com.google.firebase:firebase-storage:20.2.1")