flutter应用突然可以从firestore获取数据,状态{code = cermission_denied,description =丢失或权限不足。

发布于 2025-01-28 16:28:44 字数 885 浏览 3 评论 0原文

我一直在寻找与此有关的许多问题,但我仍然没有找到解决方案 错误说

访问隐藏方法ldalvik/system/closeguard; - > warnifopen()

[writestream]:(26986c6)流以状态关闭:status {code = codermission_denied,description =丢失或不足的权限。

[firestore]:在用户/rx5lrztkdddw1c8ribqynshligjv2上写入失败:status {code = obermission_denied,description =丢失或不足的权限。

[错误:flutter/lib/ui/ui_dart_state.cc(209)]未经手的例外:[cloud_firestore/clibrise-clibersion-diendied]呼叫者无权执行指定的操作。

而且,我试图将控制台中的Firebase Firestore规则更改为这样

service cloud.firestore {
match /databases/{database}/documents {
 match /{document=**} {
  allow read, write: if request.auth != null;
  }
 }
}

,之后仍然没有影响任何事情。通常,我仍然可以将数据获取到列表中,并在没有用户登录的情况下在GridView中显示。但是现在,即使我记录用户,它仍然没有给我任何数据。一直在检查我的飞镖代码,但没有发现任何可疑的东西。试图卸载并将其安装回。不,也没有工作。

I've been searching for a lot of problems that relate to this but I still didn't find the solution
the error says

Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, linking, allowed)

[WriteStream]: (26986c6) Stream closed with status: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}.

[Firestore]: Write failed at users/rX5LRztKddW1c8RIBqyNShligJV2: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.

and I've tried to change the firebase firestore rules in my console to be like this

service cloud.firestore {
match /databases/{database}/documents {
 match /{document=**} {
  allow read, write: if request.auth != null;
  }
 }
}

and after that still didn't affect anything. Usually I still can fetch data into a list and show in a gridview without having a user login. but now even when I log the user in it still didn't give me any of the data. been checking my dart code too and didn't find anything suspicious. tried to uninstall and install it back. nope, didnt works too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

锦欢 2025-02-04 16:28:44

我通过在Firebase控制台上未强制执行应用程序来解决问题。通过这样做,

 Project Settings > App-Check > APIs > Cloud Firestore click UnEnforce.

但就我而言,它仍然行不通。我尝试将flutter应用程序与firebase控制台断开连接,并创建一个新的,而无需连接应用程序检查功能,现在它正常工作

I Resolve the problem by Un-enforced the app check on the firebase console. by doing this

 Project Settings > App-Check > APIs > Cloud Firestore click UnEnforce.

but in my case it still won't work. and i try to disconnect the flutter app with the firebase console and create a new one without connecting the app-check feature, and it work properly now

沒落の蓅哖 2025-02-04 16:28:44

你是这样尝试的

allow read, write: if request.auth.uid != null;

还是

 service cloud.firestore {   match /databases/{database}/documents {
 match /{document=**} {
   allow read: if auth != null;
   allow write: if auth != null;
 }   } }

Did you try like this

allow read, write: if request.auth.uid != null;

or

 service cloud.firestore {   match /databases/{database}/documents {
 match /{document=**} {
   allow read: if auth != null;
   allow write: if auth != null;
 }   } }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文