After force upgrading dabs in my android application I'm getting the following error from some devices:
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int android.database.sqlite.SQLiteDatabase.getVersion()' on a null object reference at com.readystatesoftware.sqliteasset.SQLiteAssetHelper.getWritableDatabase(SQLiteAssetHelper.java:178)
Have anybody ever faced with this kind of problem and how you solved it? Thank you!
UPD: Adding the implementation of my DBManager class:
public class DBManager {
private SQLiteDatabase db;
private Context context;
public DBManager(Context context) {
DBHelper dbHelper = new DBHelper(context);
db = dbHelper.getWritableDatabase();
this.context = context;
}
private class DBHelper extends SQLiteAssetHelper {
private static final String DB_NAME = "database.db";
private static final int DATABASE_VERSION = 5;
public DBHelper(Context context) {
super(context, DB_NAME, null, DATABASE_VERSION);
setForcedUpgrade(5);
}
}
}