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 anextended error codeforSQLITE_IOERRindicating an I/O error within the xShmMap method on thesqlite3_io_methodsobject while trying to enlarge a”shm” fileas part ofWAL modetransaction 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

整合上面两个链接的探讨,汇总得出一个解决策略是:

  1. 升级WorkManager版本为最新稳定版本。
  2. 增加约束条件:
setRequiresStorageNotLow(true)

Android点击桌面小部件拉起WorkManager(CoroutineWorker)后台任务并发送Notification通知到前台通知栏,kotlin(3)_android桌面通知-CSDN博客Android桌面小部件AppWidget(2)在附录文章1的基础上,我再写一篇关于Android AppWidget的文章,本篇文章实现一个简单功能,此功能亦是对附录文章1所实现功能的增强和改进,本文的代码实现的功能:假设桌面小部件只包含一个Button和一个TextView,当点击Button后,后台启动一个服务(IntentService实现),该服务每个一秒发送一个简单的字符串。Android桌面小部件AppWidget(1)_桌面小部件窗口的类_zhangphil的博客-CSDN博客。_android桌面通知https://blog.csdn.net/zhangphil/article/details/129387567

Android WorkManager-CoroutineWorker后台运行发送Notification通知到前台通知栏,kotlin(2)-CSDN博客记得在手机的应用列表设置运行这个app允许通知。https://blog.csdn.net/zhangphil/article/details/129382843

android现代化后台任务WorkManager,kotlin(1)-CSDN博客Android可保活的、不依附于应用进程存活的后台任务框架:WorkManagerWorkManager旨在实现不依附与App进程的后台线程化任务。和JobSchedule 相似,是JobSchedule 的改进。WorkManager可实现:一次性执行任务,链式执行任务,周期性执行任务,一定条件下(网络,电量)执行任务,设备重启后执行上次未完成任务等。Android可保活的、不依附于应用进程存活的后台任务框架:WorkManager_workmanager 保活_zhangphil的博客-CSDN博客。https://blog.csdn.net/zhangphil/article/details/129379527