![](/img/trans.png)
[英]Debugging discrepancy between authentication in firebase app and rules
[英]App with firebase authentication keeps stopping
我有三个活动。 在我的应用程序中登录、创建帐户活动和 PostAccountActivity。 当单击“创建帐户”按钮时,我在 logcat window 上遇到以下 output 崩溃
2021-02-03 11:31:47.430 4954-4989/com.example.fauth E/AndroidRuntime:致命异常:grpc-default-executor-0 进程:com.example.fauth,PID:4954 java.lang.AssertionError io.grpc.internal.DnsNameResolver.getResourceResolver(DnsNameResolver.java:536) at io.grpc.internal.DnsNameResolver.access$500(DnsNameResolver.java:60) at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java: 211) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java :761)
Go 到 Firebase console > 单击您的项目 > cloud firestore > rules.....将时间戳日期编辑为您想要的日期,可能是未来的日期。 因为对我来说,时间戳日期已经过去了,所以我不得不调整到更晚的日期。 不要忘记也更改规则的版本。
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// This rule allows anyone with your database reference to view, edit,
// and delete all data in your Firestore database. It is useful for getting
// started, but it is configured to expire after 30 days because it
// leaves your app open to attackers. At that time, all client
// requests to your Firestore database will be denied.
//
// Make sure to write security rules for your app before that time, or else
// all client requests to your Firestore database will be denied until you Update
// your rules
match /{document=**} {
allow read, write: if true;
allow read, write: if request.time < timestamp.date(2022, 12, 30);
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.