2

I am trying to load https images in imageview using Glide. The image is not loading, but if I provide some local image (ex. R.drawable.error_image), it loads.

imagePath = "https://s-media-cache-ak0.pinimg.com/736x/d3/6b/83/d36b83e986e500aa7f39c722970f1f97.jpg"; // Sample image took from internet

Glide.with(this)
      .load(imagePath)
      .into(landingImage);
compile 'com.github.bumptech.glide:glide:4.0.0-RC0'

I tried to search in SOF also but did't get fix. Give suggestions thanks in advance.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Srihari
  • 2,387
  • 9
  • 51
  • 82
  • did you try to debug? And what does it mean "if I provide some error image that will load"? if you use local images, or ...? different URLs? – Markon May 29 '17 at 14:22
  • @Markon Thanks for ur valuable time. Error image means - Image from drawable in my project – Srihari May 30 '17 at 05:39

3 Answers3

2

Try downgrading to some previous version ex.

compile 'com.github.bumptech.glide:glide:3.7.0'

Have a look at this answer: Glide does not resolve its method

lidkxx
  • 2,731
  • 2
  • 25
  • 44
1

yes it is not working, same Problem i have found in Picasso and glide also but i have solved it by using below link.

Android-Universal-Image-Loader

Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
  • 1
    Feel free to provide evidence for your claim. As a counter-example, [this sample app](https://github.com/commonsguy/cw-omnibus/tree/master/HTTP/Picasso) loads HTTPS images just fine (Picasso, not Glide). – CommonsWare Jun 17 '17 at 15:36
0

It works for me by using dependancy Android-Universal-Image-Loader

implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

load image

private DisplayImageOptions options;
private void LoadImage(String image_url) {

    ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(getActivity()));

    options = new DisplayImageOptions.Builder()
            .showImageOnFail(R.drawable.ic_error)
            .cacheInMemory(true)
            .cacheOnDisk(true)
            .considerExifParams(true)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .displayer(new RoundedBitmapDisplayer(20))
            .build();


    ImageLoader imageLoader = ImageLoader.getInstance();
    //mImageViewOne : image view 
    imageLoader.displayImage(image_url,mImageViewOne,options);
}
Mahesh Pandit
  • 348
  • 3
  • 7