[英]Flutter: Internal error in Cloud Firestore (24.2.2) in Android
在调试中运行我的应用程序,没有给我任何问题,但如果在发布时运行它,它只会在Android
上崩溃,但iOS
工作正常......
使用 email 和密码登录后,它只会崩溃..
添加 crashlytics 让我明白这是来自Internal error in Cloud Firestore (24.2.2)
但代码在 iOS 中运行完美。
这是我称之为崩溃的 function。
Future<bool> signAuth(
{String? name,
String? email,
String? password,
String? gender,
String? university,
String? refCode,
String? username,
String? type,
BuildContext? context}) async {
try {
final user = (await auth.createUserWithEmailAndPassword(
email: email!, password: password!))
.user;
await user!.sendEmailVerification();
await firestore.collection('users').doc(user.uid).set({
'id': user.uid,
'username': username,
'email': email,
'name': name,
'refCode': refCode,
'university': university,
'password': password.hashCode,
'gender': gender,
'type': type
});
return true;
但不将剩余数据存储到firestore。
以防万一有人在处理Internal error in Cloud Firestore
问题,这将解决问题
步骤1:
在yourProjectName/Android/app
中创建此文件列表注意:(如果退出不需要再次创建)
proguard-android.txt
proguard-rules.pro
第2步:
复制以下配置:
-keep class io.grpc.** {*;}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
将代码粘贴到 Step 1 中创建或存在的两个文件中。
第 3 步:(然后 go 到 ==> myProjectName/Android/app/build.gradle 通过添加这一行来查看它们)
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
//add only the below code
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //Add this to it.......
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.