Reputation: 8686
So I have a recyclerview that loads pictures from Firebase Storage. I use the Glide library coupled with the FirebaseImageLoader to achieve this. All has been working fine until this past Monday. Images do not show anymore, there is no error, exception or something to help me out figure out why the images won't load anymore: Here are some code snippets:
Gradle:
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
ImageView I use to display images:
<ImageView
android:layout_width="match_parent"
android:layout_height="130dp"
android:id="@+id/imageView_promotions"
android:scaleType="centerCrop"/>
Java code that builds the Firebase storage link:
public StorageReference getThumbUri(String municipality){
return Constants.STORAGE_REFERENCE.child(Constants.PROMOTIONS).child(municipality).child(promo_thumb);
//returns e.g. gs://myfirebaseapp.com/promotions/Mahikeng/spar_thumb.png
}
Code to load the image:
Glide.with(context).using(new FirebaseImageLoader()).load(promotions.get(position).
getThumbUri(municipality)).into(holder.imageView_promotions);
P.S. This code has been working fine all along, never changed anything I swear to God. All I did was update my Android Studio to 2.3.1 and update the Google support libraries to 25.3.1
Upvotes: 1
Views: 1941
Reputation: 135
My solution in 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) }
reference is a string with name of file
Gradle:
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'
Upvotes: 2
Reputation: 8686
I managed to sort it out. If there is anyone facing the same issue, revert to Firebase SDK version 10.2.1 if you recently updated it to 10.2.4, there seems to be a bug with latest SDK.
All is well
Upvotes: 2