flutter_cache_manager icon indicating copy to clipboard operation
flutter_cache_manager copied to clipboard

DatabaseException - "unable to open database file" on iOS

Open yasin-snck opened this issue 6 months ago • 3 comments

Package: [flutter_cache_manager]
Platform: iOS
Error: DatabaseException(Error Domain=SqfliteDarwinDatabase Code=14 "unable to open database file")


🔍 Description

While using the package, I occasionally encounter the following error on iOS:

#0      wrapDatabaseException (package:sqflite_platform_interface/src/platform_exception.dart:12)
<asynchronous suspension>
#1      SqfliteDatabaseMixinExt._txnRawUpdateOrDelete.<anonymous closure> (package:sqflite_common/src/database_mixin.dart:318)
<asynchronous suspension>
#2      BasicLock.synchronized (package:synchronized/src/basic_lock.dart:36)
<asynchronous suspension>
#3      SqfliteDatabaseMixin.txnSynchronized (package:sqflite_common/src/database_mixin.dart:517)
<asynchronous suspension>

This seems to happen when the cache manager tries to update or insert entries in the database. It appears that the database file is either not found or not accessible at runtime.


✅ What I’ve Tried

  • Verified that I'm not deleting or moving the database file manually.
  • Tried using CacheManager with a custom config and custom database name.
  • Happens mostly in production or TestFlight builds — not consistently reproducible in debug mode.

yasin-snck avatar Aug 06 '25 09:08 yasin-snck

Getting this as well

owenmoon1 avatar Sep 02 '25 18:09 owenmoon1

@yasin-snck any luck?

owenmoon1 avatar Oct 16 '25 03:10 owenmoon1

I am facing the same issue. Any solution to this issue?

sabbir420 avatar Dec 03 '25 09:12 sabbir420