I want display image in imageView, that's what I'm doing: I'm using FirebaseUI to display images from FireBase Storage.
FirebaseStorage storageDisplayImg;
StorageReference storageRef;
private FirebaseAuth auth;
storageDisplayImg=FirebaseStorage.getInstance();
auth = FirebaseAuth.getInstance();
FirebaseUser userConnect = auth.getCurrentUser();
String id_user=userConnect.getUid();
storageRef = storageDisplayImg.getReference().child(item.getChemin_image()); // return gs://mydreambook-32321.appspot.com/images/test23-03-2017_16:46:55
if (item.getChemin_image() != null&&id_user != null) {
Glide.with(convertView.getContext() )
.using(new FirebaseImageLoader())
.load(storageRef)
.into(profilePic);
profilePic.setVisibility(View.VISIBLE);
} else {
profilePic.setVisibility(View.GONE);
}
But I have this error:
StorageException has occurred. Object does not exist at location. Code: -13010 HttpResult: 404
Update , Image in storage FireBase
I had the same problem right now and I realized that my image in storage ends with .jpg but my code is asking for the address that ends with .png. After I fixed that, it ran perfectly for me.
You can simply show the image in two ways using Glide method. If we want to access below method, we must change the Firebase Storage Rules. Here I included my rules.
service firebase.storage {
match /b/project-id.appspot.com/o {
match /{allPaths=**} {
allow write: if request.auth != null;
// or allow write: if true;
}
}
}
Method 1. Simply use the Firebase Reference
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReferenceFromUrl("gs://your-id.appspot.com");
StorageReference pathReference = storageRef.child("images/cross.png");
Glide.with(context)
.using(new FirebaseImageLoader())
.load(pathReference)
.into(Imageview)
Method 2. Firebase URL
Glide.with(context)
.using(new FirebaseImageLoader())
.load("Firebase_ImageURL")
.into(Imageview)
hi i faced such problem two days ago. storage exception occurs normally to the projects which you created with google developer console prior to Firebase launch. so when i connected my app to existing project on Firebase it worked. to confirm whether your project accepts storage or not go to Firebase console and on left click storage if you were displayed with the file upload option there the project is capable of storage other wise not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With