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

llegalStateException: Must call init() before using the store #40

Open
gerostam opened this issue Oct 22, 2018 · 4 comments
Open

llegalStateException: Must call init() before using the store #40

gerostam opened this issue Oct 22, 2018 · 4 comments
Assignees

Comments

@gerostam
Copy link

gerostam commented Oct 22, 2018

Hello,

I am using the library and works fine in all the devices that I tested so far. The problem is that I receive crashes in production for some older devices (i.e. Samsung Note 3 with Android 5):

llegalStateException: Must call init() before using the store in SecuredPreferenceStore.setRecoveryHandler

, but I call init as it is stated in the documentation (cannot replicate it on devices that I have available).

Please provide a fix and let me know!

@iamMehedi
Copy link
Owner

Most probably a memory issues, will check!

@iamMehedi iamMehedi self-assigned this Dec 5, 2018
@lucianommoura
Copy link

Most probably a memory issues, will check!

I dont think so. I have the same error at my application and all users have a lot of memory free.

@edgar-zigis
Copy link

We have a big user base, so I can confirm, that 95% of the crashes occur on Android 5 and earlier and the other 5% are occuring on Android 6.0-6.0.1.

@gerostam
Copy link
Author

gerostam commented Apr 5, 2019

What I did to solve this (this is not the best solution as the library should not crash) is:

SecuredPreferenceStore securedPreferenceStore;
try {
securedPreferenceStore = SecuredPreferenceStore.getSharedInstance();
} catch (Exception e) {
LOGGER.error(e.toString(), e);
generateSecuredSharedPreferences(context);
securedPreferenceStore = SecuredPreferenceStore.getSharedInstance();
}

, when I try to use the the SecuredPreferenceStore Singleton

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

No branches or pull requests

4 participants