Flutter从firebase身份验证服务获取未知错误



我已经向谷歌播放发布了我的第一个应用程序,并为几个测试用户打开了它。我正在使用Firebase身份验证服务来管理用户。

当我的测试用户尝试注册(通过电子邮件和密码(时,他们会收到一个未知的错误。在发布我的应用程序之前,我需要做什么特殊的更改吗?我的功能很简单,所以我真的不知道他们为什么会出错。

提前谢谢。

错误:

"[firebase_auth/unknown] There was an error while initializing the connection to the GoogleApi: java.lang.NoSuchMethodError: No static method isAtLeastR()Z in class La/d/g/a; or its super classes (declaration of 'a.d.g.a' appears in /data/app/com.omertab.appname--WeJcqqlq_1NPgpgJc96JQ==/base.apk)"

实例:

final _auth = FirebaseAuth.instance;

我的功能:

MaterialButton(
onPressed: () async {
_showSpinner = true;
try {
final newUser = await _auth.createUserWithEmailAndPassword(email: email, password: password);
if (newUser != null) {
await _fireStore.collection('users').add({
'email': email,
'uId': _auth.currentUser.uid
});
Navigator.pushNamed(context, HomePage.screenId);
_showSpinner = false;
}
} on FirebaseAuthException catch (e) {
_showSpinner = false;
print(e.code);
if(e.code == "invalid-email") {
print("INVALID EMAIL");
setState(() {
signupError = "Invalid mail";
});
} else if(e.code == "invalid-password") {
print("INVALID PASS");
setState(() {
signupError = "Invalid password";
});
} else if(e.code == "weak-password") {
setState(() {
signupError = "Please choose a stronger password";
});
} else if(e.code == "unknown") {
setState(() {
signupError = "Unknown error occurred";
});
}
}
},
minWidth: 200.0,
height: 42.0,
child: Text(
'Signup',
style: TextStyle(color: Colors.white),
),

问题已解决。我实施了

实现("com.google.android.gms:play services-base:17.6.0"({force=true}

构建.gradle

不是描述的问题,但它可能会对某人有所帮助。我得到了一个不同的错误:

[firebase_auth/unknown] com.google.firebase.FirebaseException: An internal error has occurred. [ CONFIGURATION_NOT_FOUND ]

我已经通过激活Firebase控制台中的身份验证服务解决了这个问题。

最新更新