我想在 imageView 中显示图像,这就是我正在做的:我正在使用 FirebaseUI 显示来自 FireBase 存储的图像。
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);
}
但我有这个错误:
StorageException has occurred. Object does not exist at location. Code: -13010 HttpResult: 404
更新,存储 FireBase 中的图像
原文由 Amal 发布,翻译遵循 CC BY-SA 4.0 许可协议
我现在遇到了同样的问题,我意识到存储中的图像以 .jpg 结尾,但我的代码要求以 .png 结尾的地址。在我修复它之后,它对我来说运行完美。