Open diegopq opened 3 years ago
Did you remove the url from the exception:
Image provider: CachedNetworkImageProvider("", scale: 1.0)
Could it be that maybe you first load an image with an empty url while you are loading the url and then reload the image again with a valid url?
Did you remove the url from the exception:
Image provider: CachedNetworkImageProvider("", scale: 1.0)
Could it be that maybe you first load an image with an empty url while you are loading the url and then reload the image again with a valid url?
The url of the images comes together with the data of the products, it is never empty. Apparently it was solved putting a size in the property memCacheHeight and memCacheWidth. This is the widget where I use the package:
`class ProductImageCache extends StatelessWidget { final double width; final double height; final double errorWidth; final double errorHeigth; final String imageUrl; final String errorUrl; final int duration; final BoxFit imageFit; final BoxFit errorFit; final Color blendColor; final BlendMode blendMode; const ProductImageCache( {Key key, @required this.imageUrl, @required this.errorUrl, this.width, this.height, this.errorWidth, this.errorHeigth, this.duration = 1000, this.imageFit = BoxFit.contain, this.errorFit = BoxFit.contain, this.blendColor, this.blendMode}) : super(key: key);
@override Widget build(BuildContext context) { return CachedNetworkImage( imageUrl: imageUrl, fadeInDuration: Duration(milliseconds: duration), fit: imageFit, width: width, height: height, color: blendColor, colorBlendMode: blendMode, useOldImageOnUrlChange: true, memCacheHeight: 500, memCacheWidth: 500, errorWidget: (context, name, _) { return Image.asset( errorUrl, width: errorWidth, height: errorHeigth, fit: errorFit, ); }, ); } }`
Overall it would be great if the plugin itself can detect invalid urls and simply switch to errorWidget instead of blindly causing an exception. Right now we have to null-check every url ourselves and work with if else + duplicate the errorWidget. There are many cases, especially user generated content, which does not always have actually an image to provide (as simple as profile images). Would make the plugin way more convenient, and in any case more stable.
I also have same issue, uri is defined, image is showing but I get error.
The image you are showing, is that really the complete code and you are not using CachedNetworkImage anywhere else? The error shows you are trying to get an image from the url "undefined". Could it be that you are setting the url on a property and you are trying to show the image before that property is set?
The image you are showing, is that really the complete code and you are not using CachedNetworkImage anywhere else? The error shows you are trying to get an image from the url "undefined". Could it be that you are setting the url on a property and you are trying to show the image before that property is set?
All the urls I am using gives error, sadly. I tried this url just to show and the url is not 'undefined'. Moreover, the image shows but I get the error.
@ragokan I'm just trying to understand what's going on. The example app doesn't do this (right?). Could you create a simple example that you can share with me that shows the problem?
@ragokan I'm just trying to understand what's going on. The example app doesn't do this (right?). Could you create a simple example that you can share with me that shows the problem?
Well, I think the problem is depended on something else, I created an empty app, there are no errors.
But for example, in this app, I just copied the image above, it is from github.
Or, I just copied the logo of google;
My dependencies; cached_network_image: ^3.0.0 dio: ^4.0.0 fl_chart: ^0.36.1 flutter_html: ^2.1.0 image_picker: ^0.8.1+1 intl: ^0.17.0 okito: ^1.2.0 share: ^2.0.4
What's the CustomIndicator?
Edit: could you maybe also try your original app without the hero?
the same issue
What's the CustomIndicator?
Edit: could you maybe also try your original app without the hero?
the same issue
I tried it again with a clean project, I didn't get any error. I think it is because of some other packages.
@ragokan Could you find what was the cause of the exception? It is really annoying to get this while debugging and I always get it for some reason :/
@ragokan Could you find what was the cause of the exception? It is really annoying to get this while debugging and I always get it for some reason :/
I just upgraded all of my packages, then it suddenly go away. I don't really know what was the cause but it results from another package.
@ragokan Could you find what was the cause of the exception? It is really annoying to get this while debugging and I always get it for some reason :/
I just upgraded all of my packages, then it suddenly go away. I don't really know what was the cause but it results from another package.
I updated my packages and the error seemed to go away if the image URL was null but it persists if the URL is not null.
======== Exception caught by image resource service ================================================
The following ArgumentError was thrown resolving an image codec:
Invalid argument(s): No host specified in URI
When the exception was thrown, this was the stack:
#0 _HttpClient._openUrl (dart:_http/http_impl.dart:2662:9)
#1 _HttpClient.openUrl (dart:_http/http_impl.dart:2568:7)
#2 IOClient.send (package:http/src/io_client.dart:35:38)
#3 HttpFileService.get (package:flutter_cache_manager/src/web/file_service.dart:35:44)
#4 WebHelper._download (package:flutter_cache_manager/src/web/web_helper.dart:121:24)
#5 WebHelper._updateFile (package:flutter_cache_manager/src/web/web_helper.dart:103:28)
<asynchronous suspension>
#6 WebHelper._downloadOrAddToQueue (package:flutter_cache_manager/src/web/web_helper.dart:71:7)
<asynchronous suspension>
Image provider: CachedNetworkImageProvider("", scale: 1.0)
Image key: CachedNetworkImageProvider("", scale: 1.0): CachedNetworkImageProvider("", scale: 1.0)
====================================================================================================
@renefloor Getting this error, although Image is showing in my ui.
@mmustafaget It looks like you are trying to load the url ""
, which is just an empty string. If you do see the image I'd guess you are loading some state and you first load the empty url and then you get the path and load the real image.
@mmustafaget It looks like you are trying to load the url
""
, which is just an empty string. If you do see the image I'd guess you are loading some state and you first load the empty url and then you get the path and load the real image.
yes YOU are right, but the thing is at the time of loading the it go-to the placeholder --but it throw the warning.
This error generates after initializing the class and before the build context. Can not track the exact point on debugging mode
.
@renefloor can you tell why is it giving error from src/web ?
I'm also facing the same situation when using ios side
having same issue Image loaded but it log error
have the same issue
I cleaned and upgrade all my packages and seemed to work.
Try running this inside your terminal project's:
flutter clean && flutter upgrade && flutter pub cache repair && flutter pub get
And now re-open your IDE and run it again.
The issue here is that the url can be empty at loading then it reload with the correct url. Now, why the library cannot detect it internally and divert to errorWidget if the errorWidget is not null ?
Get same issue too, although the image is shown and i have checked if the url is not empty
======== Exception caught by image resource service ================================================
The following ArgumentError was thrown resolving an image codec:
Invalid argument(s): No host specified in URI
When the exception was thrown, this was the stack:
#0 _HttpClient._openUrl (dart:_http/http_impl.dart:2756:9)
#1 _HttpClient.openUrl (dart:_http/http_impl.dart:2627:7)
#2 IOClient.send (package:http/src/io_client.dart:117:38)
#3 HttpFileService.get (package:flutter_cache_manager/src/web/file_service.dart:37:44)
#4 WebHelper._download (package:flutter_cache_manager/src/web/web_helper.dart:115:24)
#5 WebHelper._updateFile (package:flutter_cache_manager/src/web/web_helper.dart:96:28)
<asynchronous suspension>
#6 WebHelper._downloadOrAddToQueue (package:flutter_cache_manager/src/web/web_helper.dart:64:7)
<asynchronous suspension>
Image provider: CachedNetworkImageProvider("", scale: 1.0)
Image key: CachedNetworkImageProvider("", scale: 1.0)
if (url.isEmpty) {
return SizedBox(
height: height,
width: width,
child: ErrrorWidget(),
);
}
return CachedNetworkImage(...)
π Bug Report
I have a problem with some images, all the images are visible but in the console with some urls it throws an error and with others it does not, before it did not happen to me
Expected behavior
No error occurs when uploading images
Reproduction steps
I have a list of products each with its respective image, with this url no error occurs https://www.justpoke.club/uploads/SOPAMISO.jpg but with this one if it happens https://www.justpoke.club/uploads/EDAMAMESALVAPOR.jpg The image in both cases is shown in the application but in the case of the second image it shows me the following console error: `flutter: CacheManager: Failed to download file from with error: Invalid argument(s): No host specified in URI flutter: (debug)[2021-05-06 18:49:45.548653: βββ‘ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE βββββββββββββββββββββββββββββββββββββββββββββββββββββ The following ArgumentError was thrown resolving an image codec: Invalid argument(s): No host specified in URI When the exception was thrown, this was the stack:
0 _HttpClient._openUrl (dart:_http/http_impl.dart:2425:9)
1 _HttpClient.openUrl (dart:_http/http_impl.dart:2341:7)
2 IOClient.send
package:http/src/io_client.dart:30
3 HttpFileService.get
package:flutter_cache_manager/β¦/web/file_service.dart:35
4 WebHelper._download
package:flutter_cache_manager/β¦/web/web_helper.dart:114
5 WebHelper._updateFile
package:flutter_cache_manager/β¦/web/web_helper.dart:98