miguel alves miguel
miguel alves miguel

Reputation: 315

Populating a RecycleView with images from Storage References with Glide

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!

Upvotes: 0

Views: 75

Answers (1)

Hritik Gupta
Hritik Gupta

Reputation: 632

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

Upvotes: 2

Related Questions