android.database.sqlite.SQLiteException: Can't downgrade database from version X to Y when running an app I have problem with TitaniumBackup. I had it installed on my Android tablet which is rooted and using Android 4.4.2. It was working fine, but I had to do factory reset and after that, if I try to launch TitaniumBackup, I get 'Unfortunately, Titanium Backup has stopped'.

This is the logcat with the lines that contain references to TitaniumBackup.

Line 111: E/AndroidRuntime(26306): Process: com.keramidas.TitaniumBackup, PID: 26306
Line 112: E/AndroidRuntime(26306): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keramidas.TitaniumBackup/com.keramidas.TitaniumBackup.MainActivity}: android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 6
Line 131: E/AndroidRuntime(26306):        at com.keramidas.TitaniumBackup.MainActivity.onCreate(Source)


The error mentions


  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keramidas.TitaniumBackup/com.keramidas.TitaniumBackup.MainActivity}: android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 6


How to mitigate this issue?
[...] android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 6


This is caused when an app tries to downgrade an SQLite database from newer version, but failed since the code handle that is not implemented. (For more technical explanation: Can't downgrade database from version 2 to 1 even after fresh install and re-run).

This can also happen on Android Marshmallow (Android 6.x) or later when the data is backed up and restored after doing factory reset, leaving the data with newer version, but the app in older version.

What the user can do:


If the user wants to use the existing database: they have to find and use the version of the app that is using the current (7)/newer (>7) SQLite database version. Usually this means the user needs to update the app to the previous app's version (before the factory reset) or newer one (latest from the Play Store/developer's website).
If the user doesn't care about the existing database: depending on the database location, they can remove the database by e.g. deleting the file manually (probably need root access), cleaning the app data, etc. and let the app recreate a new database with older SQLite database version (big potential of data loss from the previous database).