I am trying to pull in an image I have added to my firebase storage on an Android device. Every time this runs I get this error from the onFailureListener()
I just noticed that the httpresult is zero. This suggests the request to get the download url was never made. One way this can happen is if play services isn't updated on your phone. You will know this is the error because adb logcat will show an error with something to the effect of "Storage network layer could not be loaded".
To fix this, update play services on your phone. There are a few ways of doing this. I find the easiest is to install the app "play services info" to see play services in the play store, and then hit update if its available.
In my case, I was creating StorageRef from Download URL not with the Storage Location.
String storageLocation="gs://bbeplayer.appspot.com/heart.png";
String downloadURL="https://firebasestorage.googleapis.com/v0/b/bbeplayer.appspot.com/o/heart.png?alt=media&token=41a22961-daf1-433e-a580-e65144d34ab3";
StorageReference reference;
reference=FirebaseStorage.getInstance().getReferenceFromUrl(downloadURL);
So I changed reference=FirebaseStorage.getInstance().getReferenceFromUrl(downloadURL);
to
reference=FirebaseStorage.getInstance().getReferenceFromUrl(storageLocation);
Update Google Play Services on your device, not in your gradle script (though do that, too).
After banging my head against the wall for about an hour due to only skimming benjamin-wulfe's answer as well as others on the internet, I came back and read it carefully. Hope this will help others avoid my mistake!
You need upload another file with more size KB, thats work for me!
I had the same problem ,solution for this is :
StorageReference storageRef = storage.getReferenceFromUrl("gs:<bucket address>");
StorageReference spaceRef = storageRef.child("child name");
I got this problem recently and mine was because of the permissions in Firebase Storage i had not allowed read, write in the Rules so i changed them to This Worked for me