Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImages no longer displayed after killing/updating the app #632
Comments
Nivl
closed this
Aug 28, 2014
Nivl
reopened this
Aug 28, 2014
This comment has been minimized.
This comment has been minimized.
Jakevin
commented
Aug 28, 2014
|
Me too! has same question.. |
This comment has been minimized.
This comment has been minimized.
npmccallum
commented
Aug 29, 2014
|
Some of my app's users are seeing the same problem. |
This comment has been minimized.
This comment has been minimized.
jzaccone
commented
Aug 30, 2014
|
Having a similar issue. When I attach a listener using I am interested to know what you guys see if you do this... |
This comment has been minimized.
This comment has been minimized.
jzaccone
commented
Aug 30, 2014
|
For me this is the same as #633. Occurs after an update from Picasso version 2.3.1 to 2.3.3, and from using HttpUrlConnection to explicitly specifying OkHttpDownloader as the downloader. build.gradle before:
picasso usage before:
build.gradle after
picasso usage after:
(see Picasso Utils) Exception.message() : Received response with 0 content-length header. Some logs: 08-30 13:47:12.244 21405-21504/? D/Picasso﹕ Dispatcher retrying [R10]+1022ms |
This comment has been minimized.
This comment has been minimized.
|
Can anyone provide a sample url? |
This comment has been minimized.
This comment has been minimized.
|
This appears to be I cant repro on the sample app...it might have to do with loading from disk...can someone with the problem debug and see the response received from downloader? |
This comment has been minimized.
This comment has been minimized.
|
Also specify what version okhttp you are using. |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Aug 31, 2014
|
I updated Picasso from 2.1.1 to 2.3.2 and updated our app. Now I am receiving daily emails about users having empty images in our app. A reinstall fixes it, but then they appear empty again so it seems related to this issue. I have not specified okhttp anywhere. Some of my gradle file: A sample image: |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Sep 1, 2014
|
I had three users install the exact same version where I changed my gradle file to: and it solved the "images-not-loading-on-app-restart" problems they had. |
This comment has been minimized.
This comment has been minimized.
cukepie
commented
Sep 9, 2014
|
I also encountered the same problem, how to fix it? #633 @JakeWharton @dnkoutso |
This comment has been minimized.
This comment has been minimized.
cukepie
commented
Sep 9, 2014
|
okhttp:2.0.0 |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Sep 12, 2014
|
@dnkoutso Any chance of an update here? We have millions of active users and have to issue an update with downgraded Picasso now because of this. Wondering switching to Glide because of this... |
This comment has been minimized.
This comment has been minimized.
mori-honest
commented
Sep 25, 2014
|
Same problem |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Oct 1, 2014
|
@JakeWharton @dnkoutso We updated our 2 million users with Picasso 2.1.1 and it solved it for all the users that had issues. Hope this bug gets fixed at some point! :-) |
This comment has been minimized.
This comment has been minimized.
|
Seems related to #594 too. |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Oct 20, 2014
|
Having the exact same issue. The images are displayed correctly - both from network and memory - but after some time (if I open the app the next day - I don't know actually what is triggering the issue) they stop showing. At first I was only using the Picasso compiled version, but tried to fix this issue by adding OkHttp. The behaviour still remains the same. I am using the following compiled version:
The issue remains with same with or without the following compiled versions:
The call to onImageLoadFailed comes with the following exception: However, if I make the request my self, these are the headers for the image: Log: UPDATE: |
This comment has been minimized.
This comment has been minimized.
ionull
commented
Nov 5, 2014
|
I have exactly the same issue. I thought it is too slow to load, but it is not. |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Nov 5, 2014
|
@ionull I was able to solve this by asking the server to add cache-control HTTP header. |
This comment has been minimized.
This comment has been minimized.
ionull
commented
Nov 5, 2014
|
@dwbrito but the image server is controlled by Microsoft, will try to roll back to an old version. |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Nov 6, 2014
|
Then it looks like the missing headers are the problem because we don't set these when uploading to Amazon S3. Problem is that we have 10000+ images without headers, will have to see if we can set them somehow. But why is this problem not present in Picasso 2.1.1? I tried moving over to Glide because of this but that introduced other issues so back on Picasso now. |
This comment has been minimized.
This comment has been minimized.
expilu
commented
Nov 26, 2014
|
I've experienced this behaviour too. Using Picasso 2.4.0 |
This comment has been minimized.
This comment has been minimized.
anxiaoyi
commented
Dec 12, 2014
|
same problem |
This comment has been minimized.
This comment has been minimized.
|
We will need to investigate this. |
dnkoutso
added this to the Picasso 2.5 milestone
Dec 12, 2014
This comment has been minimized.
This comment has been minimized.
cwhsu1984
commented
Dec 16, 2014
|
I can load image in res folder with Picasso 2.4.0 but cannot load image with url. |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Dec 17, 2014
|
We moved to 2.4.0, added cache-control headers but today we got a new users saying no images are loading for him. We have two versions on Google Play now, one with 2.1.1 and one with 2.4.0. The 2.1.1 version works fine for the user but no images load on the 2.4.0 version. We have a lot of users and it seems to only affect a very small percentage of them, but I am not sure how to help those users. Is there anything they can try on their side? This one user has tried both wifi and 3g and also tried reinstalling the app.
Here are the response headers in case it has any : Accept-Ranges:bytes |
This comment has been minimized.
This comment has been minimized.
|
in 312cce2 a change added for request replaying causing Picasso to retry requests with content-length 0. This is why it works in Picasso 2.1.1 and not 2.2 and after. We need a way to distinguish whether this was a "replay" failure or an actual server response. I think I have a fix. |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Jan 4, 2015
|
@dnkoutso I recompiled our app with the latest snapshot "picasso-2.4.1-20141231.132545-8.jar" but the user with the issues still experienced the same behavior with images not loading and loads fine with Picasso 2.1.1. Anything I can do to help investigate the issue? Not very easy to troubleshoot since it works fine for 99% of the users including me. |
This comment has been minimized.
This comment has been minimized.
cnordvik
commented
Jan 5, 2015
|
@dnkoutso Actually it seems this user have a different issue because for him the images don't load at all, not even the first time. I will try to investigate more by sending him some debug versions so maybe this issue is fixed after all. I will open a new issue if I manage to get some more information. |
This comment has been minimized.
This comment has been minimized.
|
Its not fixed in 2.5 yet. |
This comment has been minimized.
This comment has been minimized.
ricky-hufei
commented
Jan 14, 2015
|
@dnkoutso does Picasso support max-age from the HTTP header? I mean, automatically expire and evict the image from cache after "max-age" is reached. I read the whole LruCache.java file and didn't see anything specially done to track the expiration of specific image. Just want double check with you about that. Thanks. |
This comment has been minimized.
This comment has been minimized.
|
@ricky-hufei The HTTP caching is implemented by the networking client, not Picasso. |
This comment has been minimized.
This comment has been minimized.
|
What version of okhttp are you guys using? This might be fixed in the later versions of okhttp. |
This comment has been minimized.
This comment has been minimized.
|
I need a case where i can reproduce this. We have an idea of what the problem is but without reproducing this its hard to know it works. Can someone who can reproduce build and try |
dnkoutso
referenced this issue
Jan 27, 2015
Merged
Retry requests with unknown content-length and loaded from disk. #860
JakeWharton
closed this
in
#860
Jan 30, 2015
This comment has been minimized.
This comment has been minimized.
perlmonk
commented
Feb 11, 2015
|
I encouraged "Received response with 0 content-length header." before. I don't know if is related to 'If-Modified-Since' header and 304 status. I wrote a customize a downloader to solve this. Heres the real http download method. The result contains response byte data, we insert a cache between load() and this. @Override
public Response load(Uri path, boolean localCacheOnly) throws IOException {
String url = path.toString();
CachedData data = getFromCache(url);
if (data != null && data.expired) {
Result getUrlManualDealRedirect(url, data.modifiedData or data.cacheCreateDate);
if (result.getStatus() == 304) {
// the expired cache data not expires :)
// result.getContentLength() is 0
return convert(data);
} else {
// update cache
return convert(result);
}
}
// ...
}
private Result getUrlManualDealRedirect(String url, String headerIfModifideSince) throws IOException {
boolean tryNext = false;
Result result;
do {
CurlHttp curlHttp = CurlHttp.newInstance();
// Important, we care redirect(301 and 302)
curlHttp.setFollowLocation(false);
if (headerIfModifideSince != null) {
curlHttp.addHeader("If-Modified-Since", headerIfModifideSince);
}
result = curlHttp.getUrl(url).perform();
if (result.getStatus() == 301 || result.getStatus() == 302) {
String nextUrl = result.getHeader("Location");
if (url.equals(nextUrl)) {
throw new IOException("redirect loop: url=" + url + ", Location=" + nextUrl);
}
if (StringUtils.isBlank(nextUrl)) {
throw new IOException("redirect response without Location header, url=" + nextUrl);
}
url = nextUrl;
tryNext = true;
} else {
tryNext = false;
}
} while (tryNext == true);
return result;
} |
This comment has been minimized.
This comment has been minimized.
soniccat
commented
Feb 26, 2015
This comment has been minimized.
This comment has been minimized.
Jakevin
commented
Apr 21, 2015
|
is fixed now ? compile 'com.squareup.okhttp:okhttp:2.3.0' Picasso.with(context).load(url)
.transform(transformation)
.priority(Picasso.Priority.HIGH)
.networkPolicy(NetworkPolicy.OFFLINE)
.into(imageView);the same |
This comment has been minimized.
This comment has been minimized.
michaelclarkjr
commented
Sep 15, 2015
|
I'm getting similar results with Picasso version 2.5.2. Force Stop and suddenly no image is shown where previously it was showing. |
This comment has been minimized.
This comment has been minimized.
ajaykk50
commented
Dec 18, 2015
|
I'm facing the same problem now.I am not getting large images into image view from url in Picasso.Any solution for this one. |
Nivl commentedAug 27, 2014
When I install my app on my device, everything works perfectly. But when I update it (like using the "run" button from Android Studio), or just kill it (by swiping it from my "Recent apps"), the images are no longer displayed.
My code:
Logs
Looks like a cache issue to me. The URL is obviously working (locally) since it's working when I uninstall/reinstall the app. The image is not huge (58KB). It's also the only image I'm trying to load so it's probably not a cache size issue.
The code is inside getView() on a custom Adapter.