1

Everything was working fine before I added some "big" tables to my file.

I have a table that weights about 2Mo, and now I am getting this error :

07-19 00:47:51.210 4703-4703/com.lectem.gecharacters W/SQLiteAssetHelper﹕ copying database from assets... 07-19 00:47:51.280 4703-4705/com.lectem.gecharacters E/Database﹕ close() was never explicitly called on database '/data/data/com.lectem.gecharacters/databases/gechar2.sqlite' android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1810) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817) at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.returnDatabase(SQLiteAssetHelper.java:408) at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.createOrOpenDatabase(SQLiteAssetHelper.java:386) at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.getWritableDatabase(SQLiteAssetHelper.java:182) at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.getReadableDatabase(SQLiteAssetHelper.java:254)

I tried to empty the table, and it works again after this... I am using the SQLite Manager plugin for Firefox, and the SQLiteAssetHelper library.

Can't open database with SQLiteAssetHelper didn't help.

EDIT: I forgot to mention that it works fine on my phone (android 4.1) but the error occurs on my Tablet (android 2.2.1)

Community
  • 1
  • 1
Lectem
  • 503
  • 6
  • 19

1 Answers1

0

The answer was in the readme... https://github.com/jgilfelt/android-sqlite-asset-helper I was compressing my database using gzip, but it seems you really need to use zip for old devices.

Earlier versions of this library required the database asset to be compressed within a ZIP archive. This is no longer a requirement, but is still supported. Applications still targeting Gingerbread (API 10) or lower should continue to provide a compressed archive to ensure large database files are not corrupted during the packaging process. The more Linux friendly GZIP format is also supported. The naming conventions using the above example are as follows:

ZIP: assets/databases/northwind.db.zip (a single SQLite database file must be the only file within the archive)
GZIP: assets/databases/northwind.db.gz
Lectem
  • 503
  • 6
  • 19