开发者

Why does getWritableDatabase crashes on some devices? (sqlite3_open_v2 ... Failed)

开发者 https://www.devze.com 2023-04-08 08:30 出处:网络
My application uses a database and works pretty well on all Android devices. Recently some users pointed that it crashes on HTC Tattoo. I decided to give a try and got one in loan.

My application uses a database and works pretty well on all Android devices.

Recently some users pointed that it crashes on HTC Tattoo. I decided to give a try and got one in loan.

So, the error come when I call: this.getWritableDatabase();

09-27 18:26:22.292: ERROR/Database(1537): sqlite3_open_v2("/data/data/com.xxx.xxx/databases/radars.db", &handle, 6, NULL) failed
09-27 18:26:22.292: WARN/System.err(1537): android.database.sqlite.SQLiteException: unable to open database file

A开发者_高级运维nd I have checked, the Database is in the device:

Why does getWritableDatabase crashes on some devices? (sqlite3_open_v2 ... Failed)

I really cannot understand what happens....

Thank a lot for your help!

EDIT:

As noticed by LAS_VEGAS

# sqlite3 /data/data/com.xxx.xxx/databases/radars.db 

Gives this result:

sqlite3: not found 

Seem that the HTC Tattoo has serious SQL issues:

adb shell

# cd /system/xbin

# ls | grep sqlite3

//Nothing//


This is weird. I think this could happen when you try to access database file from multiple threads simultaneously. Could it be the case?

Also for testing purposes did you try getReadableDatabase(), maybe it gives a clue...

EDIT:
Can you access from remote shell?:
http://developer.android.com/guide/developing/tools/adb.html#sqlite

EDIT2:
So it seems that HTC tattoo has no sqlite3.

0

精彩评论

暂无评论...
验证码 换一张
取 消