flutter_cached_network_image
flutter_cached_network_image copied to clipboard
CachedNetworkImage is not loading images on iOS app
Overview
I am adding flutter as a module into my existing native iOS and Android application. The issue I am facing is that the image is not loading on iOS. Only the placeholder Image is displaying and not even errorWidget is getting displayed. The same codebase works fine for Android native app. I am using the below version of the library:
cached_network_image: ^3.2.1
Findings
I saw that the library is using flutter_chache_manager internally which internally uses the sqlite plugin. Since our app is also using the sqlite db and AwesomeCache library for iOS ,could it be an issue due to some conflict? This assumption is based on the fact that I created a new sample app in iOS and integrated the same flutter module into that. There it's working fine. The images are loading properly along with the placeholders.
Other things tried
I have tried setting the cacheKey and also a custom cacheManager with a unique key to avoid any conflicts but still no luck. I replaced the CachedNetworkImage with Image.network and its working fine.
Debugging
Below is my code:
CachedNetworkImage(
imageUrl: item["image"] as String, //debugger stops here
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration( //debugger never comes here
image: DecorationImage(
image: imageProvider,
fit: BoxFit.fill,
),
),
),
placeholder: (context, url) => //debugger stops here
Image.asset('assets/images/home.png'),
errorWidget: (context, url, error) =>
Image.asset('assets/images/img.png'),
)
Could anyone please help me with this pointing out the places within the library where I could debug the image loading code. Also I tried using Charles Proxy and couldn't find any network call going for those image URLs.
Any update on this?
@renefloor Any update on this?
restart app not hot reload. ios need pod install step.
same issues in IOS 16
We are also seeing this issue. I did a lot of debugging and i can trace code execution all the way to file_service.dart:35
, which is a dependency from flutter_cache_manager
. In all cases where the image is stuck in loading, this line never returns:
final httpResponse = await _httpClient.send(req);
Any updates ? Facing the same issue. I'm using cached_network_image: ^3.2.2 Can you reommand alternative/workarounds to cache network image on iOS? Thanks.
Facing same issue, is there any update on this?
Any Updates? I'm facing the same issue
I'm also having this issue, but on Android. I'm using 3.2.3.
I thought this issue also affected me (works fine on Android, but loaded images don't appear on iOS), but upon closer inspection it was down to the fact that the CachedNetworkImage
was being wrapped within an InkWell
and an Ink
widget at some point in the widget tree. Additional note here is that I'm converting the iOS app to fully use Cupertino elements rather than Material.
I'd advise checking along those lines first as I definitely haven't found an alternative library which is currently maintained, which combines caching alongside the functionality of Network.Image
.
Same problem here
Same problem.. Works fine on Android platform but images won't load on iOS. I'm trying various approaches, will come back here if something happens to work.
same issue here. any work around?
would it be caused by the breaking changes in the package cache manager? https://pub.dev/packages/flutter_cache_manager
Restart the app or try another image. That's my case.
On Sun, 5 May 2024 at 17:24, Chris @.***> wrote:
same issue here. any work around?
— Reply to this email directly, view it on GitHub https://github.com/Baseflow/flutter_cached_network_image/issues/766#issuecomment-2094703136, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMHBPX74GP2NQEAIUJPC73ZAX3FVAVCNFSM56VQWN6KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBZGQ3TAMZRGM3A . You are receiving this because you commented.Message ID: @.***>
I had to update the iOS
platform to 12.0
and restart everything. thanks