2

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

And I have checked, the Database is in the device:

enter image description here

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//

Waza_Be
  • 39,407
  • 49
  • 186
  • 260

1 Answers1

1

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.

Caner
  • 57,267
  • 35
  • 174
  • 180
  • You are close to something: # sqlite3 /data/data/com.profete162.WebcamWallonnes/databases/radars.db sqlite3: not found But, I have the file (see screenshot in my question) – Waza_Be Sep 27 '11 at 17:32
  • Seem related to this issue: http://stackoverflow.com/questions/3645319/why-do-i-get-a-sqlite3-not-found-error-on-a-rooted-nexus-one-when-i-try-to-ope – Waza_Be Sep 27 '11 at 17:40
  • I think you should get permission denied, like it says here: http://stackoverflow.com/questions/3645122/why-does-sqlite3-command-using-the-android-adb-shell-return-permission-denied, so there is something wrong with sqlite. you may need to root the device and check. – Caner Sep 27 '11 at 20:36
  • I think we are talking about 2 different issues. On your link, sqlite3: permission denied and in my case: sqlite3: not found.. So, according to this post, SQL is simply not installed on a Tattoo: http://stackoverflow.com/questions/3645319/why-do-i-get-a-sqlite3-not-found-error-on-a-rooted-nexus-one-when-i-try-to-ope – Waza_Be Sep 27 '11 at 20:45
  • Actually we are talking about the same thing. The fact that you get "not found" instead of "permission denied" shows that sqlite3 might not be there at all. – Caner Sep 28 '11 at 07:43
  • We agree, the HTC tattoo has no sqlite3. Period. Edit your answer, so I can accept it ;-) – Waza_Be Sep 28 '11 at 11:34