Handle Errors on Android

Sometimes things don't go as planned and an error occurs.

When in doubt, check the error returned and see what the error message says.

If you've checked the error message and have Storage Security Rules that allow your action, but are still struggling to fix the error, visit our Support page and let us know how we can help.

Handle Error Messages

There are a number of reasons why errors may occur, including the file not existing, the user not having permission to access the desired file, or the user cancelling the file upload.

To properly diagnose the issue and handle the error, here is a full list of all the errors our client will raise, and how they can occur.

Code Reason
storage/unknown An unknown error occurred.
storage/object_not_found No object exists at the desired reference.
storage/bucket_not_found No bucket is configured for Cloud Storage
storage/project_not_found No project is configured for Cloud Storage
storage/quota_exceeded Quota on your Cloud Storage bucket has been exceeded. If you're on the free tier, upgrade to a paid plan. If you're on a paid plan, reach out to Firebase support.
storage/unauthenticated User is unauthenticated, please authenticate and try again.
storage/unauthorized User is not authorized to perform the desired action, check your rules to ensure they are correct.
storage/retry_limit_exceeded The maximum time limit on an operation (upload, download, delete, etc.) has been excceded. Try again.
storage/invalid_checksum File on the client does not match the checksum of the file recieved by the server. Try uploading again.
storage/canceled User canceled the operation.
storage/invalid_event_name Invalid event name provided. Must be "state_changed"
storage/invalid_url Invalid URL provided to refFromURL(). Must be of the form: gs://bucket/object or https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN;>

Send feedback about...

Need help? Visit our support page.