We have a sqlite database in our Application. Its working fine for all the users but few of them experiencing the Caused by: android.database.sqlite.SQLiteException: n
Suppose if you run your app with Database Version 1, then if you alter the table structure or add a new table, you must increase your Database Version to 2 and further if you make more changes to it.
public class AppDatabase extends SQLiteOpenHelper {
// Database Name
private static final String DATABASE_NAME = "myDatabase";
// Database Version
private static final int DATABASE_VERSION = 1;
public AppDatabase(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
}
Increase this DATABASE_VERSION value if any alterations are done.