I have tried to get an Android Project working with SugarORM. However, I am running into the following error:
Caused by: android.database.sqlite.SQLiteException: no such table: DOCUMENT (code 1): , while compiling: INSERT OR REPLACE INTO DOCUMENT(ID,CREATED) VALUES (?,?) ################################################################# Error Code : 1 (SQLITE_ERROR) Caused By : SQL(query) error or missing database. (no such table: DOCUMENT (code 1): , while compiling: INSERT OR REPLACE INTO DOCUMENT(ID,CREATED) VALUES (?,?)) #################################################################
In my AndroidManifest I have defined the android:name="com.orm.SugarApp"
in my application - Tag and included
<meta-data android:name="DATABASE" android:value="idea.db" />
<meta-data android:name="VERSION" android:value="1" />
also as child tags. I have removed
<meta-data android:name="QUERY_LOG" android:value="true" />
<meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="com.example" />
from the example as they don't change anything (and others had success in removing them). I have tried to Query the db first (with findById) to "force table creation" as explained in this post. Furthermore, I have tried doing something like
SugarDb sugarDb = new SugarDb(getApplicationContext()); new
File(sugarDb.getDB().getPath())
as described here.But this runs in an error as well. Furthermore I have disabled the InstantRun-Feature as described in a few posts and here (Sugar ORM No such table exception).
Can anybody point me the right direction how to get rid of the "error or missing database"-error?