flutter_cached_network_image icon indicating copy to clipboard operation
flutter_cached_network_image copied to clipboard

How to prevent [Invalid argument(s): No host specified in URI null] error

Open hew999 opened this issue 2 years ago • 12 comments

🐛 Bug Report

How can I prevent Invalid argument(s): No host specified in URI null, When the network resource is invalid. (Sometime the server error)

Also every time throw error message occur will record to firebase crashanalytic

My app also encounter my local image load laggy when go to new page or back to previous page, it will throw this error in my debug console.

hew999 avatar Feb 09 '23 01:02 hew999

Yes, i am also facing the same issue.

Even though i have provided the error widget.

CachedNetworkImage( placeholder: (_,__)=>imageLoadingWidget(), errorWidget: (context,_,__)=>SizedBox.shrink(), imageUrl: '', width: double.infinity, height: 140, fit: BoxFit.cover, )

rishabhunthinkable avatar Feb 09 '23 15:02 rishabhunthinkable

Same problem here, fixed by manually check URL is valid.

laeo avatar Feb 12 '23 07:02 laeo

@laeo My url is valid but the resource is invalid which mean sometime my server side will throw an internal server error(5xx) or 404 not found.

hew999 avatar Feb 12 '23 13:02 hew999

求解 我也遇到这个问题了

hysz-git avatar May 29 '23 02:05 hysz-git

这个问题 我解决了;我当返回上一个界面时,上个界面需要刷新的图片控件使用的GetBuilder来处理刷新 就不会有问题了;以下是我的代码示例: GetBuilder<ConfigPublic>( init: ConfigPublic.to, initState: () {}, builder: () => ConfigPublic.to.isLogin ? Container( width: 115.r, height: 115.r, decoration: ViewUtil.boxRoundedBackground( radius: 38.r, borderColor: ColorResPublic.main_color, borderWidth: 5.r), child: controller.imgLoad.loadImg( "${ConfigPublic.to.userInfo.userIcon}", width: 110.r, height: 110.r, circular: 33.r, errorWidget: WidgetPublicUtil.getAppLogoWid(88.r)), ) : Image.asset(ImgResPublic.iv_def_user_avatar, width: 115.r, height: 115.r))

hysz-git avatar May 29 '23 03:05 hysz-git

Any updates here?

Zelkreps avatar Sep 26 '23 12:09 Zelkreps

I face same problem when server return 404 error, app is freeze and I must restart app manually, even when I use errorWidget.

vuhoangminh91 avatar Nov 20 '23 03:11 vuhoangminh91

Me too, same problem

HynDuf avatar Nov 21 '23 08:11 HynDuf

Im also getting same issue, Sometimes when i open the app just show a white screen for 1 seconds and close, When i check the crashlytics i found this exception: Screenshot from 2023-12-02 14-05-16

Im using cached_network_image: 3.2.3

devsideal avatar Dec 04 '23 09:12 devsideal

I have addressed the same thing and summarized it in this thread hopefully it will help someone.

https://stackoverflow.com/a/77195058/13910996

Zelkreps avatar Dec 04 '23 09:12 Zelkreps