Exception when storing long Strings
See original GitHub issueHi there!
First of all, awesome job on the library, it really keeps the encrypting neat and simple. Good work!
Nevertheless, I’m facing the next issue: When a long string is gonna be stored, the library throws an Exception (see below for more info). It seems to happen when the string length is over 245 characters.
String string246Chars = "AciQ7fLfNGx1l5EivLMGIDtK33Q7P2PfXrqjbKJTdPzkdplrCSlf9LZdwwE2tKNgsvW3tLTnAlr9A5mF2CdNdZjFqJBtZDiAKph4SRsmhpJ94ZM7aXRYBb8KARzyYqYnTfbBkIG3UmRSCKEYrTAB34owTNKK1t7VYrsFrUIbbG4p6OI32Yby5ORVXhLmUAy32qwjMVw0UdLur6NXCcx5Sg0kxZvM6z47IKeSdsWitlsVtHIH8TKOGP";
SecurePreferences.setValue("ALIAS", string246Chars);
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: de.adorsys.android.securestoragelibrary.SecureStorageException: Problem during Encryption
As long as I’ve not been able to see anything related to this in the documentation, Is it supposed to work like that?
Furthermore, if any user wants to store a token from backend or something similar, what can he do as an alternative?
Thanks in advice, and greetings,
Rodri
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
java - Why does storing a long string cause an OOM error but ...
When line 3332 char[] copy = new char[newLength]; is reached inside Arrays.copyOf , the exception is thrown because there is not enough memory ......
Read more >Fixing “constant string too long” Build Error - Baeldung
Learn to fix the "constant string too long" build error in Java. ... The best way is to store our string in a...
Read more >Out of Memory Exception for Java while storing large oject in ...
while in process i am trying to store this CLOB object into a String variable. When the size of CLOB, that usually is...
Read more >SQLiteConnectionProvider - OverflowException when storing ...
SQLiteConnectionProvider - OverflowException when storing a long string that was saved correctly prior to v20.1.
Read more >THROW (Transact-SQL) - SQL Server - Microsoft Learn
Raises an exception and transfers execution to a CATCH block of a TRY. ... Is a string or variable that describes the exception....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Came across the same problem and done a workaround.
Until the new release is ready, you can use this:
Was about to abandon the library due to this limit- happy to see a workaround + plans for having this in the next release. Clever!