I've been getting reports of SQLiteDiskIOExceptions for some time now (via Flurry/acra). I haven't been able to reproduce the issue locally, but it's my most frequent crash, occurring up to once in fifty sessions on a bad day. They seem to be particularly frequent under Android 2.3.x.
I make absolutely no use of SQL in my own code, but I have more than one WebView running simultaneously (two, plus an ads SDK). The errors all appear to be caused by a WebView, via one of any of the following methods:
- android.webkit.WebViewDatabase.clearCache
- android.webkit.WebViewDatabase.flushCacheStat
- android.webkit.WebViewDatabase.deleteCookies
- android.webkit.WebViewDatabase.removeCache
(Also received a couple of reports of an android.database.sqlite.SQLiteDatabaseCorruptException , but these are extremely rare). I commented out anything relating to clearing the WebView cache in my own code, but that didn't help.
Does anyone know of any way I could prevent, catch, or more clearly isolate the cause of these exceptions? They're too frequent to just be caused by bad SD memory.
Thanks!
Edit: Source code by request:
browser=(WebView)findViewById(R.id.webkit);
browser.setWebViewClient( new CustomWebViewClient(this,browser) );
WebSettings webSettings = browser.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginsEnabled(true);
browser.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
webSettings.setBuiltInZoomControls(true);
browser.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
progressbarhorizontal.setProgress(progress);
}
});
XML:
<WebView android:id="@+id/webkit" android:layout_width="fill_parent" android:layout_height="fill_parent" android:focusable="true" android:nextFocusDown="@+id/bottomview"></WebView>