flutter_cached_network_image
flutter_cached_network_image copied to clipboard
CacheManager: Failed to download file from url
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)
Flutter 1.12.13+hotfix.7
Any help would be appreciable. Thanks
I'm have the same issue:
flutter: CacheManager: Failed to download file from https://static-images.api.com.br/image/upload/f_auto,t_thumbnail/icones/pgto/******** with error: HttpException: No valid statuscode. Statuscode was 404
Flutter Version:
Flutter 1.12.13+hotfix.7 • channel stable • https://github.com/flutter/flutter.git Framework • revision 9f5ff2306b (2 weeks ago) • 2020-01-26 22:38:26 -0800 Engine • revision a67792536c Tools • Dart 2.7.0
Plugin Version:
cached_network_image: ^2.0.0
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:
CacheManager: Failed to download file from URL with error:
type '(HttpException) => Null' is not a subtype of type '(dynamic) => dynamic'
First time using the package, it took like 5 reloads of my app to successfully display the image...
- Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale sk-SK)
- cached_network_image: ^2.0.0
I have some similar issue:
CacheManager: Failed to download file from URL with error: type '(HttpException) => Null' is not a subtype of type '(dynamic) => dynamic'First time using the package, it took like 5 reloads of my app to successfully display the image...
- Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale sk-SK)
- cached_network_image: ^2.0.0
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.
@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"
same issue CacheManager: Failed to download file from ...
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.
is there any solution for this or I also have to write "the SAME ISSUE"
@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:
flutter: CacheManager: Failed to download file from null with error:
Invalid argument(s): No host specified in URI null
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?
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 use case 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 httpHeader with AuthToken to download the image using this library. Also, I am getting the error every time sometimes it successfully download the image and sometimes it gives the below error. It's really strange.
flutter: CacheManager: Failed to download file from https://*****?imageName=jpg file.jpg&path=Patient_Documents\ with error:
HttpException: Invalid statusCode: 500, uri = https://*****?imageName=jpg%20file.jpg&path=Patient_Documents%5C
@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?
@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.
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)
Please check the image file url carefully... Because I don't found any image for the given url.
In my case, add
<uses-permission android:name="android.permission.INTERNET"/>
to android/app/src/main/AndroidManifest.xml worked.
@renefloor @DhavalRKansara
flutter: CacheManager: Failed to download file from http://mt3.google.com/vt/lyrs=m&x=32752&y=21795&z=16 with error: SocketException: OS Error: Operation timed out, errno = 60, address = mt3.google.com, port = 52998 Example url: http://mt3.google.com/vt/lyrs=m&x=32752&y=21795&z=16
Operation timed out sounds like a bad internet connection.


Same Issue here! I want to test whats would happen if the url is wrong. In the case of firebase storage it returns 403. But the problem is thtat I don't know why the debugger is stopping there since I think it should be a Controlled Exception..
@cargallo That's an issue of the Dart VM, it doesn't always know if an exception is uncaught or not. See https://stackoverflow.com/questions/56802675/dart-flutter-debugger-stops-on-caught-exceptions
It should not break your app.
Tnx @renefloor I didn't knew that. Also I'm facing issues with the use of try catch and Futures and Error handling in Flutter, plus your comment I asume that Dart is some kind of immature in this context.
You can call it immature, but seeing the conversation on github about this I would not expect it to change soon if ever.
I don't think this is really a bug in the library
@renefloor I don't fully understand this issue, so this might be unfeasible, but any chance this library could benefit from the advice in https://github.com/flutter/flutter/issues/33427#issuecomment-523615622?