gpt4 book ai didi

Android sqlite 与 exFAT 文件系统崩溃

转载 作者:太空宇宙 更新时间:2023-11-03 10:50:42 24 4
gpt4 key购买 nike

我在创建新的 sqlite 数据库时遇到了问题,它基本上可以正常工作,但是我们的一些三星 Galaxy S III 客户报告说在安装我们的应用程序后崩溃了。我们发现问题出在 sqlite 调用 write() 方法时,只有当客户拥有使用 exFAT 格式化的外部 SD 卡(三星在他们的一些手机上支持)时才会发生。奇怪的是,创建文件夹有效,创建空数据库文件也有效,然后它崩溃了。它只发生在三星 ROM 上,在带有 exfat 的自定义 ROM 上它完美地工作。如何解决这个问题呢?谢谢

[21:10:36.225] W [22233][Sqlite]: (0) OPENX   59  /storage/extSdCard/Be-on-road/packages 0400102
[21:10:36.225] W [22233][Sqlite]: (0) OPEN 59 /storage/extSdCard/Be-on-road/packages
[21:10:36.225] W [22233][Sqlite]: (0) READ 59 0 0 0
[21:10:36.225] I [22233][Sqlite]: Database successfully opened /storage/extSdCard/Be-on-road/packages.
[21:10:36.238] W [22233][Sqlite]: (0) LOCK 59 SHARED was NONE(NONE,0) pid=22233 (unix)
[21:10:36.238] W [22233][Sqlite]: (0) LOCK 59 SHARED ok (unix)
[21:10:36.238] W [22233][Sqlite]: (0) UNLOCK 59 0 was 1(1,1) pid=22233 (unix)
[21:10:36.239] W [22233][Sqlite]: (0) LOCK 59 SHARED was NONE(NONE,0) pid=22233 (unix)
[21:10:36.239] W [22233][Sqlite]: (0) LOCK 59 SHARED ok (unix)
[21:10:36.239] W [22233][Sqlite]: (0) UNLOCK 59 0 was 1(1,1) pid=22233 (unix)
[21:10:36.239] W [22233][Sqlite]: (0) LOCK 59 SHARED was NONE(NONE,0) pid=22233 (unix)
[21:10:36.239] W [22233][Sqlite]: (0) LOCK 59 SHARED ok (unix)
[21:10:36.239] W [22233][Sqlite]: (0) LOCK 59 RESERVED was SHARED(SHARED,1) pid=22233 (unix)
[21:10:36.239] W [22233][Sqlite]: (0) LOCK 59 RESERVED ok (unix)
[21:10:36.239] W [22233][Sqlite]: (0) OPENX 60 /storage/extSdCard/Be-on-road/packages-journal 0400102
[21:10:36.239] W [22233][Sqlite]: (0) OPENDIR 61 /storage/extSdCard/Be-on-road
[21:10:36.239] W [22233][Sqlite]: (0) OPEN 60 /storage/extSdCard/Be-on-road/packages-journal
[21:10:36.240] W [22233][Sqlite]: (0) WRITE 60 512 0 0
[21:10:36.242] W [22233][Sqlite]: (0) LOCK 59 EXCLUSIVE was RESERVED(RESERVED,1) pid=22233 (unix)
[21:10:36.242] W [22233][Sqlite]: (0) LOCK 59 EXCLUSIVE ok (unix)
[21:10:36.242] W [22233][Sqlite]: (0) READ 60 0 512 0
[21:10:36.242] W [22233][Sqlite]: (0) SYNC 60
[21:10:36.246] W [22233][Sqlite]: (0) DIRSYNC 61 (have_fullfsync=0 fullsync=0)
[21:10:36.246] W [22233][Sqlite]: (0) WRITE 60 12 0 0
[21:10:36.246] W [22233][Sqlite]: (0) SYNC 60
[21:10:36.249] W [22233][Sqlite]: (0) WRITE 59 1024 0 0
[21:10:36.249] W [22233][Sqlite]: (0) WRITE 59 1024 1024 0
[21:10:36.249] W [22233][Sqlite]: (0) WRITE 59 1024 2048 0
............ lots of write
[21:10:36.250] W [22233][Sqlite]: (0) WRITE 59 1024 10240 0
[21:10:36.250] W [22233][Sqlite]: (0) SYNC 59
[21:10:36.263] W [22233][Sqlite]: (0) CLOSE -1
[21:10:36.264] W [22233][Sqlite]: (0) UNLOCK 59 1 was 4(4,1) pid=22233 (unix)
[21:10:36.264] W [22233][Sqlite]: (0) UNLOCK 59 0 was 1(1,1) pid=22233 (unix)
[21:10:36.264] W [22233][Sqlite]: (0) LOCK 59 SHARED was NONE(NONE,0) pid=22233 (unix)
[21:10:36.264] W [22233][Sqlite]: (0) LOCK 59 SHARED ok (unix)
[21:10:36.264] W [22233][Sqlite]: (0) READ 59 16 24 0
[21:10:36.264] W [22233][Sqlite]: (0) LOCK 59 RESERVED was SHARED(SHARED,1) pid=22233 (unix)
[21:10:36.264] W [22233][Sqlite]: (0) LOCK 59 RESERVED ok (unix)
[21:10:36.265] W [22233][Sqlite]: (0) OPENX 60 /storage/extSdCard/Be-on-road/packages-journal 0400102
[21:10:36.265] W [22233][Sqlite]: (0) OPENDIR 61 /storage/extSdCard/Be-on-road
[21:10:36.265] W [22233][Sqlite]: (0) OPEN 60 /storage/extSdCard/Be-on-road/packages-journal
[21:10:36.266] W [22233][Sqlite]: (0) WRITE 60 512 0 0
[21:10:36.266] W [22233][Sqlite]: (0) WRITE 60 4 512 0
[21:10:36.266] W [22233][Sqlite]: (0) WRITE 60 1024 516 0
............ lots of write
[21:10:36.269] W [22233][Sqlite]: (0) WRITE 60 1024 3612 0
[21:10:36.269] W [22233][Sqlite]: (0) WRITE 60 4 4636 0
[21:10:36.272] W [22233][Sqlite]: (0) OPENX 62 /storage/extSdCard/Be-on-road/etilqs_nX2uuug04YJMBLG 0500302
[21:10:36.273] W [22233][Sqlite]: (0) OPEN 62
[21:10:36.273] W [22233][Sqlite]: (778) os_unix.c:27158: (5) write() -
[21:10:36.273] W [22233][Sqlite]: (0) WRITE 62 -1 0 0
[21:10:36.273] W [22233][Sqlite]: (778) statement aborts at 22: [UPDATE app_info SET db_version=:NEW_VERSION]
[21:10:36.273] W [22233][Sqlite]: (0) READ 60 4 4624 0
[21:10:36.275] W [22233][Sqlite]: (0) READ 60 4 1540 0
............ lots of read
[21:10:36.276] W [22233][Sqlite]: (0) READ 60 4 4636 0
[21:10:36.276] W [22233][Sqlite]: (0) READ 60 4 4624 0
[21:10:36.276] W [22233][Sqlite]: (0) CLOSE -1
[21:10:36.276] W [22233][Sqlite]: (0) CLOSE -1
[21:10:36.277] W [22233][Sqlite]: (0) UNLOCK 59 1 was 2(2,1) pid=22233 (unix)
[21:10:36.278] W [22233][Sqlite]: (0) UNLOCK 59 0 was 1(1,1) pid=22233 (unix)
[21:10:36.281] E [22233][Sqlite]: Step failed: disk I/O error, code: 778. Expecting SQLITE_DONE.
[21:10:36.281] E [22233][PackageDb]: Sqlite error: disk I/O error on query UPDATE app_info SET db_version=:NEW_VERSION
[21:10:36.282] E [22233][UpdaterService]: Failed to initialize package database on service start.

最佳答案

我们终于在 SGS III 上解决了这个问题,这是一个很好的解决方法 - 我们设置临时文件默认存储在内存中而不是 sd 卡(SQLITE_TEMP_STORE=2 编译参数)并且它似乎可以工作。

关于Android sqlite 与 exFAT 文件系统崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13798826/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com