0

The image is not showing up, the context is passed from the activity with the recycleView on the Adapter Constructor.

The error code is :

    com.bumptech.glide.Registry$NoModelLoaderAvailableException: Failed to find any ModelLoaders for model: gs://my-data-7pt42.appspot.com/CompanyImages/aMBvmcvfh6RCwGn3n0WYCYY7Nxo1/logo.jpg

What I'm trying is :

    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {

        StorageReference reference = firebaseStorage.getReference().child("CompanyImages/"+idParser.get(position)+"/logo.jpg");

        holder.companyName.setText(allCompanies.get(position));

        Glide.with(context)
        .load(reference)
        .into(holder.imageRowCompany);

    }

I also tried replacing context with holder.imageRowCompany.getContext()

Any help would be appreciated! Thanks!

1 Answers1

2

When you will log the value of reference , it will not return an Image URL of logo.png,instead you will get the location of your file on google cloud.

You need to get image url of logo.png. Here you can check how to get the download url of any file from firebase. Link

Hritik Gupta
  • 611
  • 5
  • 20
  • Thanks, it worked, I wonder what [this](https://firebase.google.com/docs/storage/android/download-files#downloading_images_with_firebaseui) documentation is for thought? – miguel alves miguel May 22 '20 at 16:03
  • I just noticed , by using FirebaseUI we can directly pass the storageReference to load() method of glide to load the image.But It's strange why your code didn't work. From what I know Glide needs a secured image link i.e HTTPS to load the image and your reference variable wasn't having a secured image link. – Hritik Gupta May 22 '20 at 16:34