question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

android.database.sqlite.SQLiteException: no such table: BOOKS (code 1): , while compiling: SELECT * FROM BOOKS

See original GitHub issue

I get this issue when I try to start my app.

In onCreate I have this:

SugarContext.init(this);

My manifest contains:

<meta-data
    android:name="DATABASE"
    android:value="books.db" />
<meta-data
    android:name="VERSION"
    android:value="2" />
<meta-data
    android:name="QUERY_LOG"
    android:value="true" />
<meta-data
    android:name="DOMAIN_PACKAGE_NAME"
    android:value="com.sample.mypackage" />

(The DOMAIN_PACKAGE_NAME was changed!!)

And my class, that extends SugerRecord has an empty contructor

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jocodecommented, Oct 8, 2018

Instant-Run seems to prevent Sugar ORM from finding the “table” classes, therefore it cannot create the DB tables if you run the app for the first time

When running your app for the first time Turn off Instant run once to allow for the DB tables to be created You can enable it after the tables have been created.

Ref… Official Repo Sugar

0reactions
larrytech7commented, Aug 15, 2016

Check that your version of the database is consistent with the changes of your model objects. Each time to make changes to your model, I think you need to update your database version in the manifest.

On Tue, Aug 9, 2016, 8:59 PM Daniel Tigse notifications@github.com wrote:

I have this issue and I tried everything! The thing is that it occurs in some devices.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/satyan/sugar/issues/629#issuecomment-238672334, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMQfYoVP7ffSONWxPUVFbxYsSjfhInuks5qeNwLgaJpZM4I6EVD .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caused by: android.database.sqlite.SQLiteException: no such ...
sqlite file(in which we have table called BOOK) and saved it into "raw" folder and then copying the file and creating the database...
Read more >
Caused by android database sqlite SQLiteException no such ...
SQLiteException : no such table generalSettings (code 1): pick ... (code 1): , while compiling: select * from generalSettings at android.app.
Read more >
Caused by: android.database.sqlite.SQLiteException: no such ...
Android : Caused by: android. database. sqlite. SQLiteException : no such table : ( code 1 ) Android [ Beautify Your Computer ...
Read more >
[Developer Preview Android P] SQLiteException: no such ...
* What was the actual result? android.database.sqlite.SQLiteException: no such table: StateProvinceDB (code 1 SQLITE_ERROR): , while compiling: SELECT DISTINCT ...
Read more >
How To Resolve Android.Database.Sqlite.Sqliteexception
SQLiteException: no such table: BOOK code 1 SQLITEERROR. ... related to Android database sqlite sqliteexception no such table code 1 while compiling insert ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found