I have an app which does not explicitly create SQLite databases or anything of the sort. However, I have a few activities which create WebView widgets in order to display content from the web. Recently, I’ve seen a few strange exceptions thrown from “the wild” on 2.1-update1 devices which look something like this:
android.database.sqlite.SQLiteException: file is encrypted or is not a database
at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1751)
at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1701)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)
at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:761)
at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:754)
at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:476)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
at android.webkit.WebViewDatabase.getInstance(WebViewDatabase.java:177)
at android.webkit.WebView.<init>(WebView.java:749)
at android.webkit.WebView.<init>(WebView.java:727)
at android.webkit.WebView.<init>(WebView.java:717)
at android.webkit.WebView.<init>(WebView.java:708)
at com.example.android.dialogs.MyDialog.initialize(MyDialog.java:45)
... snip ...
Googling for this exception yielded surprisingly few results. Has anyone else seen this get thrown from WebView, and is there any workaround?
As far as I can tell, it’s a bug which was fixed in 2.2. I never found any workaround for this. =/