: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 9 columns.解决
来源:互联网 发布:淘宝教育官网首页 编辑:程序博客网 时间:2024/06/08 06:04
在android 数据库开发中碰到了这么一个错误:
E/CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 9 columns.
E/com.ishow.app.manager.AppManager: java.lang.RuntimeException: Unable to create service com.ishow.app.lbs.LBSService: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3145)
at android.app.ActivityThread.access$1800(ActivityThread.java:185)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1655)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5847)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1010)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetString(Native Method)
at android.database.CursorWindow.getString(CursorWindow.java:438)
at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:66)
at com.ishow.app.dao.impl.AccountDaoImpl.getAccount(AccountDaoImpl.java:87)
at com.ishow.app.dao.impl.AccountDaoImpl.getCurrentAccount(AccountDaoImpl.java:67)
at com.ishow.app.protocol.BaseProtocol.<init>(BaseProtocol.java:29)
at com.ishow.app.protocol.AbstractProtocol.<init>(AbstractProtocol.java:0)
at com.ishow.app.protocol.AppRecordProtocol.<init>(AppRecordProtocol.java:0)
at com.ishow.app.api.AppRecordHandler.post(AppRecordHandler.java:63)
at com.ishow.app.api.AppRecordHandler.post(AppRecordHandler.java:59)
at com.ishow.app.lbs.LBSService.onCreate(LBSService.java:57)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3135)
at android.app.ActivityThread.access$1800(ActivityThread.java:185)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1655)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5847)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1010)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
,version=2.2.5.14,exception time=2017-03-22 16:08:49
I/Process: Sending signal. PID: 19041 SIG: 9
E/CursorWindow: Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 9 columns.
E/com.ishow.app.manager.AppManager: java.lang.RuntimeException: Unable to create service com.ishow.app.lbs.LBSService: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3145)
at android.app.ActivityThread.access$1800(ActivityThread.java:185)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1655)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5847)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1010)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetString(Native Method)
at android.database.CursorWindow.getString(CursorWindow.java:438)
at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:66)
at com.ishow.app.dao.impl.AccountDaoImpl.getAccount(AccountDaoImpl.java:87)
at com.ishow.app.dao.impl.AccountDaoImpl.getCurrentAccount(AccountDaoImpl.java:67)
at com.ishow.app.protocol.BaseProtocol.<init>(BaseProtocol.java:29)
at com.ishow.app.protocol.AbstractProtocol.<init>(AbstractProtocol.java:0)
at com.ishow.app.protocol.AppRecordProtocol.<init>(AppRecordProtocol.java:0)
at com.ishow.app.api.AppRecordHandler.post(AppRecordHandler.java:63)
at com.ishow.app.api.AppRecordHandler.post(AppRecordHandler.java:59)
at com.ishow.app.lbs.LBSService.onCreate(LBSService.java:57)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3135)
at android.app.ActivityThread.access$1800(ActivityThread.java:185)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1655)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5847)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1010)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
,version=2.2.5.14,exception time=2017-03-22 16:08:49
I/Process: Sending signal. PID: 19041 SIG: 9
Disconnected from the target VM, address: 'localhost:8611', transport: 'socket'
发生错误的主要原因是:
因为需求的变动,要在原有的数据库中新增一个字段,新增了字段后所有的工作都准备得差不多了,但忽略了一个地方,就是数据库版本还没有升级,运行后先读取数据库,没有新增的字段,进而导致以上异常的发生
解决方法:
将数据库版本升级后,在数据库版本更新方法中新增该字段,问题解决
0 0
- : Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 9 columns.解决
- Android 数据库,解决Failed to read row 6, column -1 from a CursorWindow which has 11 rows, 14 columns.
- Android中出现:Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 5 columns异常
- 安卓E/CursorWindow: Failed to read row 0, column 0 from a CursorWindow which has 0 rows, 5 columns解决方案
- Failed to read row 0, column -1 from a CursorWindow which h
- IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.
- 已解决—java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.
- fail to read row 0,column -1
- Android SQLite 数据库 java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow异常
- java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow.异常
- java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow异常
- 数据库Log之Couldn't read row 0, col -1 from CursorWindow
- Android示例java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.
- va.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor
- Couldn't read row 0, col -1 from CursorWindow, Cursor initialization error
- ExpandableListView异常Couldn't read row 0, col -1 from CursorWindow
- IllegalStateExceptio: Couldn't read row * from CursorWindow due to CursorWindow.nativeGetLong
- Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before
- Javascript之旅——第一站:从变量说起
- Javascript之旅——第二站:对象和数组
- Javascript之旅——第三站:几个需要注意的运算符
- Javascript之旅——第四站:parseInt中要注意的坑
- Javascript之旅——第五站:说说那些所谓的包装类型
- : Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 9 columns.解决
- Java调用Oracle存储过程时,给in语句传入参数的方式
- Javascript之旅——第六站:看看writable特性
- linux下 Vi 操作命令
- linux多进程使用
- Javascript之旅——第七站:说说js的调试
- ServU漏洞利用靶场-单兵作战
- 腾讯文智自然语言处理-分词API Python小实验
- Javascript之旅——第八站:说说instanceof踩了一个坑