Error when used with cached_network_image by setting up the cacheManager
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- dart, flutter
- Área
- mobile-dev
Línea de trabajo
Reproduce el problema con cached_network_image 3.2.3 y flutter_cache_manager 3.3.0 usando un CacheManager configurado con un stalePeriod de dos horas y captura el error completo y el stack trace. Rastrea la operación de limpieza de la caché que informa de “No such file or directory” en Android e iOS; se considera completado cuando el escenario reproducido termina sin un error no gestionado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 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



- Lenguaje dominante
- Dart
- Estrellas
- 810
- Forks
- 510
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 11
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Baseflow/flutter_cache_manager
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Baseflow/flutter_cache_manager#450 · 9 comentarios · 8 reacciones ·
-
Retaining original file names Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
Baseflow/flutter_cache_manager#507 · 1 comentario ·
-
sqflite_android update Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
Baseflow/flutter_cache_manager#501 · 1 comentario · 3 reacciones ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Baseflow/flutter_cache_manager#500 · 1 comentario · 3 reacciones ·
Todos los issues de Baseflow/flutter_cache_manager
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
[Super Editor][Chat] - Floating editor scaffold does not reset panel height after closing panel Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
a2ui-project/a2ui#2763 ·
-
[FR] 移动评论点赞按钮到左边 Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bggRGjQaUbCoE/PiliPlus#3062 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
AOSSIE-Org/Ell-ena#332 ·