0

只有少数用户出现以下错误,我真的不知道在哪里寻找这个错误,因为sql数据库文件在正确的位置,sql管理器打开它然后找不到那里的表!

我注意到这只是在使用支持 V4 库的 CursorLoader 时发生的,可能错误在该代码中?

任何建议或答案都会有所帮助。

java.lang.RuntimeException: An error occured while executing doInBackground()
    at android.support.v4.b.r.done(SourceFile:137)
    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    at java.lang.Thread.run(Thread.java:856)Caused by: android.database.sqlite.SQLiteException: no such table: records: , while compiling: SELECT _id, name, isbackground FROM records ORDER BY _id ASC
    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:68)
    at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:143)
    at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:127)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:94)
    at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:53)
    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1564)
    at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:354)
    at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:291)
    at com.voicepro.db.RecordsContentProvider.query(SourceFile:289)
    at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
    at android.content.ContentResolver.query(ContentResolver.java:311)
    at android.support.v4.b.f.loadInBackground(SourceFile:49)
    at android.support.v4.b.f.loadInBackground(SourceFile:35)
    at android.support.v4.b.a.onLoadInBackground(SourceFile:240)
    at android.support.v4.b.b.doInBackground(SourceFile:51)
    at android.support.v4.b.b.doInBackground(SourceFile:40)
    at android.support.v4.b.q.call(SourceFile:123)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) android.database.sqlite.SQLiteException: no such table: records: , while compiling: SELECT _id, name, isbackground FROM records ORDER BY _id ASC
    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:68)
    at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:143)
    at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:127)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:94)
    at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:53)
    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1564)
    at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:354)
    at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:291)
    at com.voicepro.db.RecordsContentProvider.query(SourceFile:289)
    at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
    at android.content.ContentResolver.query(ContentResolver.java:311)
    at android.support.v4.b.f.loadInBackground(SourceFile:49)
    at android.support.v4.b.f.loadInBackground(SourceFile:35)
    at android.support.v4.b.a.onLoadInBackground(SourceFile:240)
    at android.support.v4.b.b.doInBackground(SourceFile:51)
    at android.support.v4.b.b.doInBackground(SourceFile:40)
    at android.support.v4.b.q.call(SourceFile:123)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    at java.lang.Thread.run(Thread.java:856)
4

1 回答 1

1

可能是损坏或不完整的数据库。检查发生这种情况的设备,并可能尝试获取数据库的副本。不直接相关,但尽量不要混淆支持库,一些代码依赖子类/方法名。

于 2012-09-05T02:56:21.097 回答