0

我们有一个用户在摩托罗拉 PLUS 上运行我们的应用程序,当我们尝试从 sqlite db 读取时,他得到以下异常。

我们已经尝试完全删除应用程序和数据库并重新安装它。

我们还尝试使用简单的 rawquery 查询数据库,但没有成功。

欢迎任何建议!

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:274)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
    at java.lang.Thread.run(Thread.java:1019)
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.compile(SQLiteCompiledSql.java:92)
        at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
        at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
        at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
        at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
        at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1365)
        at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
        at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280)
        at com.voicepro.db.RecordsContentProvider.query(SourceFile:289)
        at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
        at android.content.ContentResolver.query(ContentResolver.java:266)
        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:306)
        ... 4 more
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.compile(SQLiteCompiledSql.java:92)
        at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
        at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
        at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
        at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
        at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1365)
        at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
        at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280)
        at com.voicepro.db.RecordsContentProvider.query(SourceFile:289)
        at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
        at android.content.ContentResolver.query(ContentResolver.java:266)
        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:306)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
        at java.lang.Thread.run(Thread.java:1019)
4

1 回答 1

1

i had the same problem. my guess is that it doesn't happen on all devices as you said- but the problem is not the sqlite version, the problem is probably because in some place in your code you deleted the table (in my case i deleted the cache for a web client). go over your code and re-exam it.

see: Strange SQLiteException not in all devices

于 2012-11-07T14:18:37.433 回答