简体   繁体   English

此错误是什么意思?

[英]what does this error means?

i got lots of crashes on lots of devices but on my device(lg p920) it works fine. 我在很多设备上都崩溃了,但是在我的设备上(lg p920),它工作正常。 the below report is from goggle play my app crashed and got 6 reports. 下面的报告来自goggle play我的应用程序崩溃了,并得到6条报告。 by the way i use sql pre created database.and also created android_metadata table and locale en_US also inserted to that database. 顺便说一下,我使用sql预先创建了database.and还创建了android_metadata表,并且还将语言环境en_US插入了该数据库。

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 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. 指示访问SQLite数据库文件时发生IO错误的异常。

Reference: SQLiteDiskIOException . 参考: SQLiteDiskIOException

Reference : https://stackoverflow.com/a/4828540/1318946 参考: 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/”; 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. 我想这条路径可能在Desire HD的Android 2.2.1上无效。 I exchanged this path with: Environment.getDataDirectory() + “/data/YOUR_PACKAGE/databases/” + DB_NAME; 我将以下路径交换为: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. 如果有人测试此解决方案,请让我知道它是否可以解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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