Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
740 stars 429 forks source link

https://github.com/Baseflow/flutter_cache_manager/issues/135 #264

Closed sudhakaranswell closed 3 years ago

sudhakaranswell commented 3 years ago

https://github.com/Baseflow/flutter_cache_manager/issues/135 https://github.com/Baseflow/flutter_cached_network_image/issues/399

Issue: Cannot open file, path = '/var/mobile/Containers/Data/Application/ B861D1-3A04-498D-AC67-23E00574DD1C/Library/Caches/ libCachedImageData/fdbf1150-a040-11ea-d6f9-4168d77.bin' (OS Error: No such file or directory, errno = 2)

Repo:

Go to the Application Settings of the Android system to clear the application cache. Do not clear all data At this point, go back to your Flutter app and look at the image loaded. The image cannot be displayed. you will get

"Cannot open file, path = '/var/mobile/Containers/Data/Application/ B861D1-3A04-498D-AC67-23E00574DD1C/Library/Caches/ libCachedImageData/fdbf1150-a040-11ea-d6f9-4168d77.bin' (OS Error: No such file or directory, errno = 2)"

Problem:

Because libCachedImageData sub-folder will be removed while clear cache from setting. So file.openWrite() will not create the file and will throw the above exception.

File: web_helper.dart Function: _saveFileAndPostUpdates Line Number: 189 Code: final sink = file.openWrite();

:sparkles: What kind of change does this PR introduce? Bug fix

:arrow_heading_down: What is the current behavior? - Develop

:new: What is the new behavior (if this is a feature change)?

:boom: Does this PR introduce a breaking change?

:bug: Recommendations for testing - Not required

:memo: Links to relevant issues/docs

https://github.com/Baseflow/flutter_cache_manager/issues/135 https://github.com/Baseflow/flutter_cached_network_image/issues/399

:thinking: Checklist before submitting