User does not have permission to access this object . Firebase storage android

Go to storage -> Rules tab

add this

// Anyone can read or write to the bucket, even non-users of your app.
// Because it is shared with Google App Engine, this will also make
// files uploaded via GAE public.
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write;
    }
  }
}

enter image description here


Just go to Storage - Rules. Enter the rule as following, replacing the bucket name with your own bucket name. You can find the bucket name by going to Storage - Files.

It should look something like this: myapplication-xxxx.appspot.com

That's all you need. You don't need to enable authentication, if you are doing it for testing purposes only. If you need authentication, you can add it later.

enter image description here


Change your storage rules in Firebase console

enter image description here

service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}

Update your security rules with match /{allPaths=**} to indicate that public read and write access is allowed on all paths:

service firebase.storage {
  match /b/savephoto-a1cc3.appspot.com/o {
    match /{allPaths=**} {
      // Allow access by all users
      allow read, write;
    }
  }
}

Various default rules are provides in the tabs of the Sample Rules section of the documentation.