Can't downgrade database from version 2 to 1 even after fresh install and re-run

后端 未结 10 1166
离开以前
离开以前 2020-12-16 01:14

I\'m writing an android app using SQLite DB.

I had few experiments and changed the DB version from 1 to 2.

Then my DB schema became stable and because i didn

10条回答
  •  Happy的楠姐
    2020-12-16 01:50

    This exception is thrown on the following conditions:

    • The device that you're running the code on has a database file of version 2.
    • The code is requesting version 1 of the database (with a param to SQLiteOpenHelper constructor)
    • onDowngrade() is not overridden in your code.

    You say the code worked fine the first time after a fresh install. Make sure there's no other code that would bump up the version number of the same database file to 2 again.

提交回复
热议问题