Search code examples
fluttergoogle-cloud-firestorefirebase-security

Firebase Firestore permission denial


I have an flutter app that talks to the same collection and everything works fine. However, I have another flutter app app which I have also added to Firebase and done all the configuration as in the first app but I keep getting the error as added below.

[Firestore]: Listen for Query(target=Query(consultations/6437f769a0016e1e8fe563b0/matters order by name);limitType=LIMIT_TO_FIRST) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}

Also, I have set my rules as follows

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

I will really need someone to point me in the right direction. Thanks


Solution

  • Apparently, I needed to clean my project and rebuild. This is because, I changed the firebase' google-services.json file from a previous firebase account to the current one.