Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Error when used with cached_network_image by setting up the cacheManager

オープン
#410 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
dart, flutter
領域
mobile-dev

調査の方向性

cached_network_image 3.2.3 と flutter_cache_manager 3.3.0 を使用し、stalePeriod を2時間に設定した CacheManager で問題を再現し、完全なエラーとスタックトレースを取得します。Android と iOS で「No such file or directory」と報告するキャッシュクリーンアップ操作を追跡します。再現したシナリオが未処理のエラーなしに完了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

🐛 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
  1. Set up a project using the cached_network_image and flutter_cache_manager packages.
  2. Configure the stalePeriod to be short (my case was 2 hours).
  3. Run the project in development mode.
  4. Close the app.
  5. Wait for more than the statePeriod. In my case around 1 or 2 days.
  6. 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

image
image
image

主要言語
Dart
スター
810
フォーク
510
平均マージ
2日 2時間
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Baseflow/flutter_cache_manager のほかの issue

Baseflow/flutter_cache_manager の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。