You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know what you mean. The cache manager tries to download the file you request from the internet. Once it is downloaded it caches it and serves it to you. This error is clearly a fail during the download phase. No host specified in URI means that the url doesn't start with http or https, that's why I ask you the url, because the url is wrong.
if url is wrong,I hope image use placeholder ,but it throw a exception
I don't know what you mean. The cache manager tries to download the file you request from the internet. Once it is downloaded it caches it and serves it to you. This error is clearly a fail during the download phase. No host specified in URI means that the url doesn't start with http or https, that's why I ask you the url, because the url is wrong.
if url is wrong,I hope image use placeholder ,but it throw a exception
It shouldn't throw an exception, but only log the exception. Does your app crash from this? If you use the errorWidgetBuilder I think the error isn't logged as well.
It shouldn't throw an exception, but only log the exception. Does your app crash from this? If you use the errorWidgetBuilder I think the error isn't logged as well.
I think it is just logging in that case. If you really find an app crashing due to this please reopen this issue, but I really think just the placeholder is shown. You can also try this yourself by trying to show a wrong image url on purpose.
I think it is just logging in that case. If you really find an app crashing due to this please reopen this issue, but I really think just the placeholder is shown. You can also try this yourself by trying to show a wrong image url on purpose.
the before "cached_network_image 2.3.1" is Ok,"2.3.1" this error is too many
I think it should disappear if you supply an errorBuilder, you can use the same content of course as in the placeholder. Or maybe you can tweak how your app logs these exceptions
Yes, but that's NetworkImage, that source from the main Flutter repo. I used that as an example to show that an ImageProvider needs to throw an exception when loading fails to the ImageWidget can handle the failed loading.
Activity
renefloor commentedon Aug 31, 2020
That is an error when your url is invalid. Does the url start with
http(s)://?yyzl0418 commentedon Aug 31, 2020
I used "cached_network_image 2.3.1" ,this error always appear
renefloor commentedon Aug 31, 2020
What's the url of the image you try to show?
yyzl0418 commentedon Aug 31, 2020
i don't know,but Why is the wrong address used cache
renefloor commentedon Aug 31, 2020
I don't know what you mean. The cache manager tries to download the file you request from the internet. Once it is downloaded it caches it and serves it to you. This error is clearly a fail during the download phase.
No host specified in URImeans that the url doesn't start with http or https, that's why I ask you the url, because the url is wrong.yyzl0418 commentedon Aug 31, 2020
if url is wrong,I hope image use placeholder ,but it throw a exception
if url is wrong,I hope image use placeholder ,but it throw a exception
renefloor commentedon Aug 31, 2020
It shouldn't throw an exception, but only log the exception. Does your app crash from this? If you use the errorWidgetBuilder I think the error isn't logged as well.
Edit: btw, here is the code from the Flutter framework that logs the error if you don't give an errorlistener with the image widget: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/image.dart#L127
yyzl0418 commentedon Aug 31, 2020
my app caught this exception, and submit server
renefloor commentedon Aug 31, 2020
I think it is just logging in that case. If you really find an app crashing due to this please reopen this issue, but I really think just the placeholder is shown. You can also try this yourself by trying to show a wrong image url on purpose.
yyzl0418 commentedon Aug 31, 2020
the before "cached_network_image 2.3.1" is Ok,"2.3.1" this error is too many
renefloor commentedon Aug 31, 2020
I think it should disappear if you supply an errorBuilder, you can use the same content of course as in the placeholder. Or maybe you can tweak how your app logs these exceptions
yyzl0418 commentedon Aug 31, 2020
this method throw a exception ,but you don't catch
@renefloor
renefloor commentedon Aug 31, 2020
That's right. It is the imageprovider that handles the exception. Same happens in NetworkImage: https://github.com/flutter/flutter/blob/e8c942104bb4b414b67e303a54b00e8fc45c67a6/packages/flutter/lib/src/painting/_network_image_io.dart
yyzl0418 commentedon Aug 31, 2020
why need rethrow,my app caught this error
renefloor commentedon Aug 31, 2020
What do you mean? Which rethrow?
yyzl0418 commentedon Aug 31, 2020
this "rethrow"
renefloor commentedon Aug 31, 2020
Yes, but that's NetworkImage, that source from the main Flutter repo. I used that as an example to show that an ImageProvider needs to throw an exception when loading fails to the ImageWidget can handle the failed loading.
I showed this code that the Flutter ImageWidget logs the error silently if you don't provide an errorListener:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/image.dart#L127-L143