glide
glide copied to clipboard
Glide not loading images with androidx
Hi, I have recently migrated to use andriodx libraries and now glide has stopped loading images. Earlier glide was loading images perfectly.
Currently I am using glide 4.16.0 version.
implementation 'com.github.bumptech.glide:glide:4.16.0' implementation 'com.github.bumptech.glide:annotations:4.16.0' implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
I am using self signed certificate and before migrated to androidx, I was using same self signed certificate and images are loading fine.
Now I am getting this issues.
com.bumptech.glide.load.HttpException(Forbidden, status code: 403)
com.bumptech.glide.load.HttpException(Misdirected Request, status code: 421)
I have extended AppGlideModule and provided OkHttpClientExt as mentioned in the URL https://medium.com/@mustafayanik/how-to-fix-android-glide-ssl-exception-ab9b2c4dbada
but still no luck.
I am using https calls for getting and posting data to my server and all working fine.
Yes, as mentioned I am using integration library, OkHttp3. I am using Techno Spark 20c BG7 phone device.
this is my code example of using glide.
GlideApp.with(context) .load(url) .placeholder(placeHodler) .error(errorImage) .transform(new CropCircleTransformation(context)) .listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
Log.e(TAG, "loadImageWithGlide::onLoadFailed::-------- model=" + model + " msg=" + e.getMessage() + " isFirstResource=" + isFirstResource);
return false;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
Log.d(TAG, "loadImageWithGlide::onResourceReady:: -----------------------dataSource = " + dataSource);
return false;
}
})
.into(imageView);
I have implemented jsDelivr CDN. if I put url https://cdn.jsdelivr.net/gh/sikanderrafiq/Images/userimages/Screenshot_2023-07-18-05-33-37-83.png
in the browser, then it is showing image perfectly (before migrating to androidx, glide was working fine and showing images properly)
Please help me out what I am missing. I am highly thankful to you for this favor.
Thanks, Sikander