android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 4874 SQLITE_IOERR_SHMSIZE): , while compiling: PRAGMA journal_mode
sqlite错误代码4874:
Result and Error Codeshttps://www.sqlite.org/rescode.html#ioerr_shmsize
(4874) SQLITE_IOERR_SHMSIZE
The SQLITE_IOERR_SHMSIZE error code is an extended error code for SQLITE_IOERR indicating an I/O error within the xShmMap method on the sqlite3_io_methods object while trying to enlarge a "shm" file as part of WAL mode transaction processing. This error may indicate that the underlying filesystem volume is out of space.
Android抛错:
android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 4874 SQLITE_IOERR_SHMSIZE): , while compiling: PRAGMA journal_mode
谷歌官方的bug追踪平台有相关探讨:
https://issuetracker.google.com/issues/152202040
https://issuetracker.google.com/issues/179708452
整合上面两个链接的探讨,汇总得出一个解决策略是:
- 升级WorkManager版本为最新稳定版本。
- 增加约束条件:
setRequiresStorageNotLow(true)