我在创建新的sqlite数据库方面遇到问题,它主要起作用,但我们的一些三星Galaxy S III客户在安装我们的应用程序后报告崩溃。我们发现问题是当sqlite调用 write()方法时,它只在客户使用exFAT格式化外部SD卡时才会发生(三星支持他们的某些手机)。 奇怪的是,创建文件夹工作,创建空数据库文件也有效,然后崩溃。 它只发生在股票三星ROMs,在自定义rom与exfat它完美的工作。 如何解决这个问题呢? 谢谢
[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.
答案 0 :(得分:1)
我们终于在SGS III上解决了这个问题,这是一个很好的解决方法 - 我们设置临时文件默认存储在内存中而不是sd-card(SQLITE_TEMP_STORE = 2编译参数),它似乎有效。