Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AlexSuvorov2k opened this issue Aug 16, 2018 · 5 comments
Open

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

AlexSuvorov2k opened this issue Aug 16, 2018 · 5 comments
Assignees

Comments

@AlexSuvorov2k
Copy link

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?

@humazed humazed self-assigned this Aug 16, 2018
@humazed
Copy link
Owner

humazed commented Aug 16, 2018

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

@humazed
Copy link
Owner

humazed commented Aug 16, 2018

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

@AlexSuvorov2k
Copy link
Author

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

Can you tell me how i can provide steps?

@humazed
Copy link
Owner

humazed commented Aug 21, 2018

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

@hecter123456
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants