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
I had the same problem, it's related to Instant Run. Disable instant run, reinstall the application, and it works.
See this link for details on how to enable or disable Instant Run.
For me the Issue was, In my app I had two different Database. so, I only changed the from version 1 to version 2. My first DB had version 1
Please check this property
<`meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="trending.hashtags.pojo" />`
This should be exactly where your POJO class is not the package name only.
As stated in the README from the github repo, if you are using proguard, you should ensure that entities remain un-obfuscated so table and columns are named correctly.
To do so, add this line to proguard-rules.pro
:
-keep class com.yourpackage.yourapp.domainclasspackage.** { *; }
When you're starting initial development and don't want to have to increase your Database version for changes made during quick iterations of your models (something I do a lot while I'm fleshing out unforeseen requirements), use this during your applications start-up:
SugarDb sugarDb = new SugarDb(getApplicationContext());
new File(sugarDb.getDB().getPath()).delete();
Model.findById(Model.class, (long) 1); // Perform this for each SugarRecord model
// Insert test data:
Modelrecord = new Model("Model Title", "Model content", false);
record.save();
Be warned - this will remove all data from your database so persisted changes between debug sessions won't work, however it does allow you to release version 1 of your app version 1 of your database.
I do not recommend doing this after version 1 has been officially released, make sure you log ALL changes needed using the SugarORM Migration Method.
Make sure the meta data package name points to where you've put your model entities not app package name