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
(running Flutter 3.32.8, flutter_cache_manager: ^3.4.1 on a MacOS)
Just a quick check it seems like:
cache_store.dart > class CacheStore
_Future removeCachedFile
successfully remove files from the _memCache
though the absolute path of the file is wrong showing this:
"/Users//Library/Containers//Data/filename.jpg"
instead of
"/Users//Library/Containers//Data/Library/Caches//filename.jpg"
So line 187
final file = io.File(cacheObject.relativePath);
points to a non existing file
and line 189
if (file.existsSync())
always fails.
This creates a secondary defect as now files will be re-downloaded and duplicated in disk.
For a potential fix, you might want to look into this PR: 3d1995f
same issue here, _cleanupCache does not work because its using a relative path, it can't find the file on that directory when it clearly is, it is not using the appropriate path.
using the fileSystem instead of directly using File seems to have fixed the issue. createFile creates the File object not the actual file, so its fine to use it here.
Activity
hafizramiz commentedon Sep 7, 2025
I have got same issue
void _clearCache() async{
DefaultCacheManager().emptyCache();
setState(() {
fileStream = null;
});
}
It is not remove cache
colnaghijr commentedon Sep 9, 2025
(running Flutter 3.32.8, flutter_cache_manager: ^3.4.1 on a MacOS)
Just a quick check it seems like:
cache_store.dart > class CacheStore
_Future removeCachedFile
successfully remove files from the _memCache
though the absolute path of the file is wrong showing this:
"/Users//Library/Containers//Data/filename.jpg"
instead of
"/Users//Library/Containers//Data/Library/Caches//filename.jpg"
So line 187
final file = io.File(cacheObject.relativePath);
points to a non existing file
and line 189
if (file.existsSync())
always fails.
This creates a secondary defect as now files will be re-downloaded and duplicated in disk.
For a potential fix, you might want to look into this PR: 3d1995f
desmeit commentedon Sep 10, 2025
@hafizramiz
I have temporarily solved it manually until the plugin developer addresses the problem:
diegogarciar commentedon Dec 30, 2025
same issue here, _cleanupCache does not work because its using a relative path, it can't find the file on that directory when it clearly is, it is not using the appropriate path.
diegogarciar commentedon Dec 30, 2025
using the fileSystem instead of directly using File seems to have fixed the issue. createFile creates the File object not the actual file, so its fine to use it here.
diegogarciar commentedon Dec 30, 2025
seems the fix is already on main
[mob][photos] Pin flutter_cache_manager to delete fix (#11308)
rickdijk commentedon Jul 27, 2026
This is merged into main and published in the latest version