Developer
Developer

Reputation: 1

Android ORMLite DatabaseConfigUtil and library project

I am trying to create a Library project for andorid and I am using ORMLite.

Within my library project I have created ormlite_config.txt within the res/raw folder. However, when I make a jar of the library project, it gets sealed. So I get the following error.

java.alang.RuntimeException: Unable to start activity [activityName]: java.lang.IllegalStateException: Could not load object config file

Caused by: java.sql.SQLException: DatabaseTableConfig reading from stream cannot parse line: [random characters]

I have thought about using app specific config file stored on device and reading that. But with that is that I cannot get the application context when I run the DatabaseConfigUtility.

Has anyone ran into this problem before? Your help will be much appreciated!

Upvotes: 0

Views: 242

Answers (1)

Arun Mehra
Arun Mehra

Reputation: 559

in the class where you are extending OrmLiteSqliteOpenHelper you might be creating a constructor where you would call super class constructor just pass NULL in place of your "R.raw.ormlite_config", the ormlite_config file in my raw folder didn't contain any code , I had the EXACT SAME problem and this solved it for me. Hope this helps you.

Upvotes: 1

Related Questions