picasso: Picasso does not load the image nor does it log
I am supplying picasso through Koin (DI).
This is my Picasso configuration
fun getPicasso(context: Context, downloader: OkHttp3Downloader): Picasso {
return Picasso.Builder(context)
.downloader(downloader)
.indicatorsEnabled(true)
.loggingEnabled(true)
.build()
}
This is theOkHttp3 and OkHttp3Downloader
fun getPicassoDownloader(okHttpClient: OkHttpClient): OkHttp3Downloader {
return OkHttp3Downloader(okHttpClient)
}
fun getOkHttpInstance(headerInterceptor: HeaderInterceptor, loggingInterceptor: HttpLoggingInterceptor, cache: Cache): OkHttpClient {
return OkHttpClient.Builder()
.addInterceptor(headerInterceptor)
.addInterceptor(loggingInterceptor)
.cache(cache)
.build()
}
This OkHttp3 is a singleton used across every entity that requires it such as Retrofit, Picasso.
I then load the image like this in a recycler view
picasso.load(image.urls?.regular)
.fit()
.centerCrop()
.into(itemView.item_image)
I have logged the URL’s and verified that the URL’s are working But I see no image in the imageView nor do I see any logs as I’ve set logging interceptor to be true.
I also tried commenting out the OkHttpDownloader instance in picasso so that I use the default configuration. But that doesn’t work either.
Picasso Version : 2.71828 OkHttp3Downloader Version: 1.1.0 OkHttp3 Version : 3.10.0
Android Device : One Plus 6 Android Version : 8.1.0 Android OS : Oxygen OS 5.1.8
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 4
- Comments: 21 (3 by maintainers)
Here is working project with the issue. https://github.com/Kolyall/Picasso271828 To fix it use
com.squareup.picasso.OkHttp3Downloader
instead ofcom.jakewharton.picasso.OkHttp3Downloader
Be oversure image URL path with https protocol, hopefully, it will be work!!!
Example:
https😕/bangladhol.com/book_th/C29B5E81.jpg
instead of
http😕/bangladhol.com/book_th/C29B5E81.jpg
@FantasyLand17 gave me a hint I removed this form my code and it’s working fine.
I can confirm that this issue is still present after updating to Picasso 2.7. I have narrowed it down to this:
This does NOT work
This works ( Notice missing OkHttp3Downloader ):
I am not sure how to debug this but what appears to be happening is that something is going on with OkHttp3Downloader and PIcasso 2.7
EDIT: it looks like there is a reason for that #31
@JakeWharton maybe this issue could be closed?
OLD: The same happened to me, using OkHttp3Downloader 1.1.0 with Picasso 2.7 results in no images showing with the following code:
but it works as expected if the downloader is removed.
Can confirm, replacing Jake’s Downloader with Squareup OkHttp3Downloader fixed this issue. (Using picassoVersion = ‘2.71828’)
I confirm that no image is shown when we use OkHttp3Downloader with Picasso 2.7 Version 2.7 works fine without setting a downloader
I met the “same” problem and finally found out the reason: my system time was incorrect, accidentally set system time to future. That’s not Picasso’s problem. 😛
I have similar problem I have updated from
2.5.2
to2.71828
And changedPicasso.with(context)
toPicasso.get()
On previous version everything worked, URL are validHere is the log: with transformation
without