【发布时间】:2020-02-29 12:23:53
【问题描述】:
我正在尝试通过 url 从 firebase 存储加载图像,但所有图像都没有被加载,有些正在加载,有些没有我正在使用下面的代码和 Picasso 库来加载图像
Picasso.get().load(post.getPost_user_profile_pic_url())
.resize(200, 200)
.centerCrop()
.into(postUserImage);
当我尝试如下使用 Glide 库时
Glide.with(itemView.getContext()).load(post.getPost_user_profile_pic_url()).into(postUserImage);
我得到了以下
W
/Glide: 加载失败 https://firebasestorage.googleapis.com/………… 尺寸 [120x120] com.bumptech.glide.load.engine.GlideException 类:加载资源失败 有1个原因: java.io.FileNotFoundException(https://firebasestorage.googleapis.com/v0/b/....................) 调用 GlideException#logRootCauses(String) 了解更多细节 原因(1 之 1):com.bumptech.glide.load.engine.GlideException 类:获取数据失败, 类 java.io.InputStream, 远程
我怎样才能纠正这个问题,以确保所有各自的图像都是从 URL 加载的?
【问题讨论】:
-
你能粘贴你得到的完整错误吗?为了更好的想法
-
记住 url 应该使用 HTTPs 而不是 HTTP
-
@RanjeetLuhar 我已经用更多细节更新了错误,正如你所说,它是 HTTPS
-
如您所见,正在发生 FileNotFoundException。因此,请再次检查图像 url,以便每个系统文件不存在。
-
@RanjeetLuhar 我检查了网址,每个网址都有文件
标签: android firebase picasso android-glide