4

My application is throwing this

Fatal Exception : unknown error (code 14) could not open database

when running on Android Kitkat 4.4, The application is running perfectly on all the previous versions.

Exception is being thrown in this line.

            myDataBase = SQLiteDatabase.openDatabase("path", null, SQLiteDatabase.OPEN_READWRITE);

I have tried everything from SQLiteDatabase.create(); SQLiteDatabase.opendatabase(); SQLiteDatabase.openorcreatedatabase(null); . But still the exception is being thrown in this line.

2

1 Answer 1

0

If your variable path is a secondary external storage as a sdcard then you can not write data, how to create a db file sqlite . Android 4.4 prevented the writing of data at this location and manufacturers as Samsung has followed the same. The error message does not help to know what is really happening. See :

https://source.android.com/devices/storage/index.html#multiple-external-storage-devices

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.