RoomAsset icon indicating copy to clipboard operation
RoomAsset copied to clipboard

Can't downgrade read-only database from version 2 to 1

Open AlexSuvorov2k opened this issue 7 years ago • 5 comments

Hello! Trying to create pre-populated database. My Database @Database(entities = {Series.class}, version = 2, exportSchema = false) ... public static AppDatabase getDatabase(Context context) { if (INSTANCE == null) { synchronized (AppDatabase.class) { if (INSTANCE == null) { INSTANCE = RoomAsset.databaseBuilder(context, AppDatabase.class, DB_NAME) .allowMainThreadQueries() .build(); } } } return INSTANCE; }

Problem is: `I/SQLiteAssetHelper: successfully opened database cymbalsbase.db

W/SQLiteAssetHelper: Can't downgrade read-only database from version 2 to 1:

Upgrading database cymbalsbase.db from version 2 to 1...

missing database upgrade script: databases/cymbalsbase.db_upgrade_0-1.sql

E/SQLiteAssetHelper: no upgrade script path from 2 to 1

D/AndroidRuntime: Shutting down VM

E/AndroidRuntime: FATAL EXCEPTION: main`

What can i do?

AlexSuvorov2k avatar Aug 16 '18 20:08 AlexSuvorov2k

try to uninstall the current version and install a new one and see if the problem still exists.

humazed avatar Aug 16 '18 22:08 humazed

I can't reproduce this error on my end, can you provide the steps leading to this exception?

humazed avatar Aug 16 '18 23:08 humazed

I uninstall app on emulator and install it, then i get this error.

Can you tell me how i can provide steps?

AlexSuvorov2k avatar Aug 17 '18 04:08 AlexSuvorov2k

I still can't reproduce your error. can you provide a minimum working example so I can work on fixing this problem.

humazed avatar Aug 21 '18 20:08 humazed

W/SQLiteAssetHelper: Can't downgrade read-only database from version 2 to 1 I solve this problem by using read-write database instead or you can change database version to 1.

hecter123456 avatar Sep 12 '18 02:09 hecter123456