Android: Sugar ORM No Such Table Exception

后端 未结 21 1112
一生所求
一生所求 2020-12-05 06:42

I am getting the No Such table exception when i am Using Sugar ORM with GPU image Android Library. I am using Gradle and Android Studio. Once i remove GPU image

21条回答
  •  星月不相逢
    2020-12-05 06:59

    To create model tables, I use to execute this for all my models once my Application starts:

    Book.findById(Book.class, (long) 1);
    Car.findById(Car.class, (long) 1);
    

    My Application extends SugarApp, so this forces Sugar to create all tables.

    On the other hand, to update your database, you have to change your version to 2.

    And finally, having an empty constructor is a must.

    Hope this helps! ;)

提交回复
热议问题