问题
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.
回答1:
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
回答2:
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
回答3:
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);
}
来源:https://stackoverflow.com/questions/44244748/why-glide-is-not-loading-https-images-in-android