Android sqlite returned: error code = 14 [duplicate]
Possible Duplicate:
Android sqlite returned: error code = 14
I have a own created SQLite database that i include in assets folder in my Android app, its has works really good.
Before i start using first my realeased version from market and then uninstall the application with all data and run debug on my developmen开发者_如何学Pythont version of the app, then i started get "sqlite returned: error code = 14" and what i can see when i logging is that its copying the file to the right folder and not getting any error.
But when its start reading from it its gets the error and then its can not find the tables in the file.
I have tried on my development phone to reinstall the whole phone and then all works again, i startaed install the Market released version then uninstalled it and install the development version and its no problem then.
But on my phone i using for everything else its still a problem and i dont whant to reinstall the whole phone for this.
I have tried uninstall the application with adb and still the same problem.
Someone out there that has any idea how to fix this?
Looks like not a problem for normal users but when i develop and using the different versions its some problem, and i has not changed the database between the two versions...
This happens when something bad has gone into the DB. By bad, I mean something SQLite is not able to read when get is used. That's why uninstalling the app and reinstalling it in the emulator typically works. The solution would be to look into what you are storing and figuring out where things are not OK.
(suggestion from user1526732): Use 'SQLite Database Browser' to examine your DB thoroughly!
Today this issue cost me 3 hours. What I tried:
- Rewriting the copy database code.
- Deleting the app from the emulator / device
- Wiping emulator(s)
- Cleaning eclipse
- Changing file permissions
- Validate that the SQLite database file is working
I solved the problem by copying the code from a shared Dropbox account to another location and refactoring the code in the Android Manifest and java files with another package name.
The application runs beautifully now.
精彩评论