Jorge Quiñones
Jorge Quiñones

Reputation: 311

redux-persist/getStoredState: Error restoring data for key: xxxxx

redux-persist has been working perfectly for me with smaller size state trees, but trying to use it on bigger ones I'm running into these errors when relaunching the app:

redux-persist/getStoredState: Error restoring data for key: pos Error: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before

Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. Error: Couldn't read row 0, col 0 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

I've tried things like this in MainApplication.java - onCreate method: *long size = 50L * 1024L * 1024L; // 50 MB com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size)*

But it seems not work.

Thanks in advance

Upvotes: 2

Views: 1351

Answers (1)

Dani Akash
Dani Akash

Reputation: 7096

Looks like you have hit the maximum size limit for storing data in Android AsyncStorage which is currently 6MB.

I can see that you increased the AsyncStorage size to 50MB but however, it is still possible that your data's size is greater than 50MB. You can use the following plugin which makes use of fileSystem instead of AsyncStorage to persist your Redux state:

https://www.npmjs.com/package/redux-persist-filesystem-storage

This way you wouldn't have to worry about AsyncStorage size limit.

Upvotes: 6

Related Questions