0

当我运行有关数据库版本号的程序时,出现以下 logcat 错误

Caused by: android.database.sqlite.SQLiteException: Can't downgrade database from version 2 to 1

关于如何解决这个问题的任何想法?

4

1 回答 1

2

Right now, your app has a database with schema version 2. As the error indicates, you are trying to downgrade to schema version 1, which apparently is not supported.

You are welcome to uninstall your app, thereby deleting the existing database, then install it again (e.g., run it from your IDE).

However, I would recommend that you sit back and consider why your existing database has a higher version number than your code is requesting, as that is an unusual state to get into.

于 2014-08-24T22:11:45.880 回答