简体   繁体   中英

what does this error means?

i got lots of crashes on lots of devices but on my device(lg p920) it works fine. the below report is from goggle play my app crashed and got 6 reports. by the way i use sql pre created database.and also created android_metadata table and locale en_US also inserted to that database.

this is the STACK TRACES:

android.database.sqlite.SQLiteDiskIOException: disk I/O error
    at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
    at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2074)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1014)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:962)
at offline.sinhaladic.com.MainActivity.sugen(MainActivity.java:1312)
at offline.sinhaladic.com.MainActivity$7.afterTextChanged(MainActivity.java:972)
at android.widget.TextView.sendAfterTextChanged(TextView.java:7665)
at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:8067)
at android.text.SpannableStringBuilder.sendTextHasChanged(SpannableStringBuilder.java:900)
at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:353)
at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:266)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:443)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:420)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:29)
at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:663)
at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:425)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:333)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

This is not a common error you'll see. It can happen rarely on some device with low internal memory. While your app was trying to write to DB, it ran out of internal memory and failed to write. What you can do is check the available storage and if its really dropping to zero, notify user.

SQLiteDiskIOException

java.lang.Object
   ↳    java.lang.Throwable
       ↳    java.lang.Exception
           ↳    java.lang.RuntimeException
               ↳    android.database.SQLException
                   ↳    android.database.sqlite.SQLiteException
                       ↳    android.database.sqlite.SQLiteDiskIOException

An exception that indicates that an IO error occured while accessing the SQLite database file.

Reference: SQLiteDiskIOException .

Reference : https://stackoverflow.com/a/4828540/1318946

One thought that popped up is the hard coded path to where the database file is located. DB_PATH = “/data/data/YOUR_PACKAGE/databases/”;

I guess it is possible that this path isn't valid on Android 2.2.1 for Desire HD. I exchanged this path with: Environment.getDataDirectory() + “/data/YOUR_PACKAGE/databases/” + DB_NAME;

I'll try to pin point the issue when I had the chance to test on the actual phone myself. If anyone test this solution, please let me know if it solves it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM