Firebase存储用户界面和滑动不显示图像
所以我有一个从Firebase存储加载图片的回收站。 我使用与FirebaseImageLoader结合的Glide库来实现这一点。 直到上个星期一,所有的工作都很好。 图像不再显示,没有任何错误,exception或者帮助我弄清楚为什么图像不会加载了:下面是一些代码片段:
摇篮:
compile 'com.github.bumptech.glide:glide:3.7.0' compile 'com.firebaseui:firebase-ui-storage:1.2.0'
ImageView我用来显示图像:
构建Firebase存储链接的Java代码:
public StorageReference getThumbUri(String municipality){ return Constants.STORAGE_REFERENCE.child(Constants.PROMOTIONS).child(municipality).child(promo_thumb); //returns eg gs://myfirebaseapp.com/promotions/Mahikeng/spar_thumb.png }
加载图片的代码:
Glide.with(context).using(new FirebaseImageLoader()).load(promotions.get(position). getThumbUri(municipality)).into(holder.imageView_promotions);
PS此代码一直工作正常,从来没有改变任何我向上帝发誓。 我所做的只是将我的Android Studio更新到2.3.1,并将Google支持库更新为25.3.1
我设法把它整理出来。 如果有人面临相同的问题,如果您最近将其更新至10.2.4,则还原为Firebase SDK版本10.2.1,但似乎存在最新SDK的错误。
一切都很好
我在Kotlin的解决方案:
if (reference != null && reference.isNotEmpty()) { val storageReference = FirebaseStorage.getInstance().reference.child(reference) storageReference.downloadUrl.addOnSuccessListener { uri -> Glide.with(context) .load(uri) //.centerCrop() .into(mImage) }
引用是一个带有文件名称的字符串
摇篮:
compile 'com.github.bumptech.glide:glide:4.0.0-RC0' annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0' compile 'com.firebaseui:firebase-ui:2.0.1'