question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IllegalStateException

See original GitHub issue

I init the KeyGenerator by this code:

keyGenerator = KeyStoreKeyGenerator.get(application, application.getPackageName());

But I got the IllegalStateException:

W/System.err: java.lang.IllegalStateException: java.security.InvalidKeyException: Failed to unwrap key
W/System.err:     at in.co.ophio.secure.core.KeyStoreKeyGenerator.<init>(KeyStoreKeyGenerator.java:51)
W/System.err:     at in.co.ophio.secure.core.KeyStoreKeyGenerator.get(KeyStoreKeyGenerator.java:56)

How can I resolve this problem?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
adrientruongcommented, Feb 21, 2017

Hi. I’m using this in an Android app and have users crashing on this problem. I read the Stackoverflow link you posted, however I am not 100% clear on what it means. Is there a fix for this issue or is it completely unavoidable?

1reaction
marcinbakcommented, Mar 15, 2018

@mjurekov @vashisthg @ragdroid I have found a workaround for this issue. The cause is https://issuetracker.google.com/issues/37137351

Created pull request with the workaround https://github.com/ophio/secure-preferences/pull/26 but Travis seems not able to create emulator and failed check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IllegalStateException (Java Platform SE 7 ) - Oracle Help Center
Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is...
Read more >
java - What is IllegalStateException? - Stack Overflow
Usually, IllegalStateException is used to indicate that "a method has been invoked at an illegal or inappropriate time." However, this doesn't look like...
Read more >
How to Solve java.lang.IllegalStateException in Java main ...
IllegalStateException is the child class of RuntimeException and hence it is an unchecked exception. This exception is rise explicitly by ...
Read more >
IllegalStateException - Android Developers
Constructs an IllegalStateException with no detail message. A detail message is a String that describes this particular exception.
Read more >
java.lang.IllegalStateException: Can not perform this action ...
IllegalStateException : Can not perform this action after onSaveInstanceState at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1265)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found