Here on this place ( book.save() ) an exception is thrown (screen below):

enter image description here Table model:

enter image description here

Androidmanifest.xml :

enter image description here

An exception screen that crashes:

enter image description here

  • 3
    Screenshots instead of code are bad practice. - post_zeew
  • one
    Try replacing <meta-data android:name="VERSION" android:value="2" /> with <meta-data android:name="VERSION" android:value="3" /> . - post_zeew
  • And Instant Run disconnect. - post_zeew
  • Strange, I changed value = "3" and everything was recorded ... in general, it was originally value = "1", I found the same advice on the Internet, I changed it to 2, it still did not help ... and the 3rd version went well ... what does it all depend on? Is this the orm version itself? - Heaven
  • one
    Replace screenshots with text. - pavlofff

2 answers 2

The SQLiteException: no such table exception obviously indicates that the table you are trying to perform any manipulations on does not exist.

You may have changed the database schema, but forgot to increment the version of the database schema in AndroidManifest.xml .

In AndroidManifest.xml replace:

 <meta-data android:name="VERSION" android:value="2" /> 

on:

 <meta-data android:name="VERSION" android:value="3" /> 

VERSION is a version of the database schema.

And yet, when working with Sugar ORM it is better to disable Instant Run.

    In the exception, usually, a direct error is written. You have this:

     ... no such table: BOOK 

    That is, you are trying to insert a new row into a table that has not yet been created in the SQLite database.

    • So the point is, it must itself be created together with the object ... - Heaven