Error when used with cached_network_image by setting up the cacheManager
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- dart, flutter
- Ambito
- mobile-dev
Direzione di ricerca
Riprodurre il problema con cached_network_image 3.2.3 e flutter_cache_manager 3.3.0 usando un CacheManager configurato con uno stalePeriod di due ore, quindi acquisire l’errore completo e lo stack trace. Tracciare l’operazione di pulizia della cache che segnala “No such file or directory” su Android e iOS; è completato quando lo scenario riprodotto termina senza un errore non gestito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 Bug Report
I am experiencing an issue while using the flutter_cache_manager package along with the cached_network_image package in my Flutter project. I have set the cacheManager property and set the stalePeriod to 2 hours for my cache configuration. When I run my project in development mode after 1 or 2 days, an error occurs which stops the app process. The error message will be in screenshots. But the ending is: "OS Error: No such file or directory, errno = 2".
It seems like the app is trying to delete a non-existing cache file.
Expected behavior
The app should run without any issues, and the cache should be managed appropriately.
Actual behavior
The app "crashes" (in development mode) with the error message "OS Error: No such file or directory, errno = 2".
Reproduction steps
- Set up a project using the
cached_network_imageandflutter_cache_managerpackages. - Configure the
stalePeriodto be short (my case was 2 hours). - Run the project in development mode.
- Close the app.
- Wait for more than the
statePeriod. In my case around 1 or 2 days. - Run the project again in development mode.
Configuration
Flutter version: It was 3.5.x or 3.6.x. Now I use 3.7.11
cached_network_image package version: 3.2.3
flutter_cache_manager package version: 3.3.0
Device/Emulator: Android emulator on Windows & iOS emulator on Mac
OS: Windows 11 & MacOS
Additional Context
Here is the code snippet where I configure the cache manager and use the CachedNetworkImage widget:
Widget _buildPhoto(bool useDarkMode) {
return CachedNetworkImage(
imageUrl: photoUrl,
height: height,
alignment: const Alignment(-1.0, -1.0),
cacheManager: CacheManager(
Config(
'photoCache',
stalePeriod: const Duration(hours: 2),
),
),
fadeInDuration: Duration.zero,
fadeOutDuration: Duration.zero,
placeholder: (context, url) => Container(
color: useDarkMode ? DarkColors.lightColor : LightColors.lightColor,
),
errorWidget: (
BuildContext context,
String url,
dynamic error,
) {
return Container(
width: double.infinity,
height: height,
color: useDarkMode ? DarkColors.lightColor : LightColors.lightColor,
);
},
);
}
}
Platform:
- 📱 iOS



- Lingua principale
- Dart
- Stelle
- 810
- Fork
- 510
- Merge medio
- 2g 2h
- PR unite (30g)
- 11
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Baseflow/flutter_cache_manager
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Baseflow/flutter_cache_manager#450 · 9 commenti · 8 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
Baseflow/flutter_cache_manager#507 · 1 commento ·
-
sqflite_android update Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 30/100
Baseflow/flutter_cache_manager#501 · 1 commento · 3 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Baseflow/flutter_cache_manager#500 · 1 commento · 3 reazioni ·
Tutte le issue di Baseflow/flutter_cache_manager
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
from.page-issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
[Super Editor][Chat] - Floating editor scaffold does not reset panel height after closing panel Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
a2ui-project/a2ui#2763 ·