-
-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CacheManager: Failed to download file from url #336
Comments
Flutter 1.12.13+hotfix.7 Any help would be appreciable. |
I'm have the same issue:
Flutter Version: Plugin Version: |
i have this same problam |
@sandeep9607 @samuelematias or @taekungkub can any of you give me a valid URL that does load in the browser (and doesn't give a 404), but does not load in the CachedNetworkImage? |
I have some similar issue:
First time using the package, it took like 5 reloads of my app to successfully display the image...
|
This only happened when using an Emulator to run my app. When I switched to my physical device, the errors did not appear.... this is strange. I also tried disabling Proxy settings on the android emulator, but with no change. |
Does anyone solved this issue? |
@dodancs that is really strange, as far as I know an emulator works the same as a physical device. |
@renefloor Doesn't seem like it. I'm not sure what could be causing this. But I spent a lot of hours trying to fix my "broken code" to only realize it was because of the emulator. I also never seen anything like this before. |
It is also happening on physical phone too |
same issue CacheManager: Failed to download file from ... |
is there any solution for this or I also have to write "the SAME ISSUE" |
It actually is working fine for me now, my URL was not returning any data first. Could be something else for other but for me it's working perfectly fine now. |
@DhavalRKansara you could help in looking for a solution. I don't know why files sometimes fail to download, as I still don't have a reproducible example of an url that should work but doesn't |
@renefloor Actually You guys can add one null and empty check before network request for the image and if image URL is null then simply show the placeholder image means no need to do network request for null image URL. Because in my case I have some image URL as null or empty and then I am getting the error:
|
Hmm, not sure if I agree with that. Why the placeholder and not the error widget? I would expect an error when the image is null. What is your usecase that null is a valid image? |
Yeah totally agree we can show error image In case of null or empty image URL. |
This is really Strange, Now I am also facing the same issues while downloading the images. In my case, I have to pass
@renefloor Have you faced the error in any example? |
@DhavalRKansara a statusCode 500 normally is something going wrong on the server. I guess you have to discuss this with the backend developer. I don't know if you have content with him/her? |
@renefloor Yes I have discussed with my backend developer and also for the same URL I have tried to get an image through the postman and I successfully get the image in postman. That's why I am saying that not every time I got failed to download network image it's 50-50 scenario and still I'm looking into it with different testing scenarios. |
Please check the image file url carefully... Because I don't found any image for the given url. |
In my case, add
to |
flutter: CacheManager: Failed to download file from http://mt3.google.com/vt/lyrs=m&x=32752&y=21795&z=16 with error: |
Operation timed out sounds like a bad internet connection. |
Exactly same issue here. In that scenario, I'd expect the plugin to render errorWidget and silent the error. Imagine you have a list of 10+ invalid image links, every time you hot-reload this list you need to click 10+ times continue on the debugger to do debugging... IMHO the plugin should gracefully handle invalid image URL error if errorWidget is provided, otherwise throw error as it is. Thanks for the great plugin though :) |
Same issue here. the app seems to be crashing in production due to cached_network_image. Im playing around with https://pub.dev/packages/optimized_cached_image/ lets see how that goes |
The issue still remains, and the odd thing is that happens only on certain devices. |
I think most problems seem to be with non-english file naming. I've never had a problem with image files named only in English. Is there any solution about this? |
I also experienced this issue, and could not find a flutter way to solve the 404 issue which crashes the app. As a solution, I am using imagekit as a CDN and we can tell imagekit to display a default image if the original image is missing: https://docs.imagekit.io/features/default-images |
Thanks for this great plugin. But why the console is cluttered with all that exceptions even if I provided an error builder? |
I managed to reproduce the error locally - and I have a more descriptive logs from crashlytics:
can anyone from the contributors look at this? |
It happens to me yesterday too plss fix itt |
will someone take a look at this? |
add comment
|
Thank you very much, it solved my problem, thumbs u |
This is a really good package, I would hate to switch to a different one. |
This is a constant complaint for long time and I am not sure if this message is reaching authors.
Can anyone want to consider forking or submit a pull request with fix ? Should be simple since it is just some error messages printing.
… On May 18, 2022, at 2:02 PM, Hasan M. Hallak ***@***.***> wrote:
Thanks for this great plugin.
But why the console are cluttered with all that exceptions even if I provided an error builder?
I have a list of user with like 20+ image and this is very annoying.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
For crashlytics as a workaround you can filter for this Error before actually sending it to crashlytics like this: FlutterError.onError = (flutterErrorDetails) async {
if (flutterErrorDetails.library == "image resource service" &&
flutterErrorDetails.exception
.toString()
.startsWith("HttpException: Invalid statusCode: 404, uri")) {
return;
}
await FirebaseCrashlytics.instance
.recordFlutterFatalError(flutterErrorDetails);
return;
}; |
PS C:\Users\User\Desktop\OKD\okd> flutter run
FAILURE: Build failed with an exception.
BUILD FAILED in 17s how to solve this error |
I believe this works for solving firebase crashes, but there is another problem: If you have a given URL, say example.com/image-123.png and server returns According to HTTP specifications, 4XX errors means some sort of client error, and therefore the problem is the request, not the server. You shouldn't retry the same request for 4XX errors because I'd expect the same response each time. Therefore, the cache library should store the result (HTTP 404) and return that instead. |
has anyone in the community found an alternative library that properly caches HTTP 4XX results? |
It's so sad that the maintainers doesn't consider this as an issue |
It's been 4 years, but they still don't acknowledge this as an issue!!! |
I just found this library and ran into this issue. It is pretty disappointing that the developers fail to acknowledge this as a problem. For some reason or the other an invalid URL can be provided where the reasonable expectation would be for the error widget to be rendered in the image's place. It's a shame the developers have taken this stance. The plugin is otherwise great. |
apparently, the issue is in newer versions of Flutter. I found out that Flutter 3.10.6 works without any issues. |
3.3.1 Still have this problem |
According to the changelog, with CachedNetworkImage version 3.3.1 errors are no longer reported to the global error handler if you add an errorListener. |
cached_network_image: ^2.0.0
I/flutter (23961): CacheManager: Failed to download file from http://host/images/a.png with error:
I/flutter (23961): SocketException: Failed host lookup: 'host' (OS Error: No address associated with hostname, errno = 7)
The text was updated successfully, but these errors were encountered: