title: Android Glide and Volley: Unable to display Images stored in Firebase Storage
body: <p>I know the solution exists where people say that using the image caching tools like <em>Glide</em> or <em>Picasso</em>, you can display the images. But I have tried the same and it won't work.</p>
  
  <p>Here is my implementation of uploading files to Firebase Storage</p>
  
  <pre><code> if (uri != null) {
          //upload to storage
          StorageReference riversRef = imagesRef.child(uri.getLastPathSegment());
          UploadTask uploadTask = riversRef.putFile(uri);
          // Register observers to listen for when the download is done or if it fails
          uploadTask.addOnFailureListener(new OnFailureListener() {
              @Override
              public void onFailure(@NonNull Exception exception) {
                  // Handle unsuccessful uploads
                  Snackbar.make(coordinatorLayout, "Unable to process your request. Please try again.", Snackbar.LENGTH_SHORT).show();
              }
          }).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
              @Override
              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                  // taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.
                  Uri downloadUrl = taskSnapshot.getMetadata().getDownloadUrl();
                  if (downloadUrl != null) {
                      Date date = new Date();
                      Locale locale = new Locale("en", "IN");
                      SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy /h:mm a", locale);
                      String formattedDate = sdf.format(date);
  
                      HashMap&lt;String, String&gt; map = new HashMap&lt;&gt;();
                      map.put("isXRead", String.valueOf(false));
                      map.put("isYRead", String.valueOf(true));
                      map.put("imgUrl", String.valueOf(downloadUrl));
                      map.put("timestamp", formattedDate);
                      map.put("user", "X");
                      ref.push().setValue(map);
                  }
              }
          });
      }
  </code></pre>
  
  <p>The image gets uploaded well and returns the url, similar to</p>
  
  <pre><code>https://firebasestorage.googleapis.com/v0/b/private.appspot.com/o/Messenger_images%2F14076?alt=media&amp;token=2164ec58-55c2-4b03-b97a-ebfd36e66593
  </code></pre>
  
  <p>Here is how I'm trying to display the image using Volley:</p>
  
  <pre><code>ImageRequest ir = new ImageRequest(message.getImgUrl(), new Response.Listener&lt;Bitmap&gt;() {
              @Override
              public void onResponse(Bitmap response) {
                  // callback
                  // new GlideOperations(context, img).glideMessenger(response);
                  img.setImageBitmap(response);
              }
          }, 100, 100, null, null);
          //ir.setShouldCache(false);
          AppController.getInstance().addToRequestQueue(ir);
  </code></pre>
  
  <p>Here is how I'm trying to display the image using Glide:</p>
  
  <pre><code> try {
          Glide.with(mContext)
                  .load(object)
                  .thumbnail(0.5f)
                  .override(900, 400)
                  .crossFade(100)
                  .fitCenter()
                  .error(R.drawable.wallpaper)
                  .into(new SimpleTarget&lt;GlideDrawable&gt;() {
                      @Override
                      public void onResourceReady(GlideDrawable resource, GlideAnimation&lt;? super GlideDrawable&gt; glideAnimation) {
                          try {
                              mImageView.setImageDrawable(resource); 
                          } catch (Exception e) {
                              e.printStackTrace();
                          }
                      }
                  });
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>None of the above seems to work. Appreciate any help.</p>
  
  <p><strong>Solution</strong>
  Seems like I had problem with the <code>ImageView</code> I was using. Thanks for your help.</p>