I've been having these Permission Denied when testing firebase in my flutter project, and I can't figure it out. I'm using email authentication and it works in flutter. But after reading about this error in other posts, I tried to allow read , write for all in my security rules :
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
But I still get the same error:
W/RepoOperation(24227): setValue at /1_testing failed: DatabaseError: Permission denied
W/RepoOperation(24227): setValue at /2_testing failed: DatabaseError: Permission denied
E/flutter (24227): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(-3, Permission denied, , null)
My code for sending data is:
final databaseReference = FirebaseDatabase.instance.reference();
void createRecord(){
databaseReference.child("1_testing").set({
'title': 'It worked once',
'description': 'blablibla'
});
databaseReference.child("2_testing").set({
'title': 'it worked twice',
'description': 'blobloblo'
});
I also re-downloaded and sync my json file Do you have any ideas ? It's the first time I'm trying this so sorry in advance if the answer seems obvious :/