expo: 'Could not encrypt the value for SecureStore' error on android standalone app
Context
- Error in standalone app on android
- Work fine in Expo app
- SDK 22
Android java stack trace
W/SecureStoreModule(23138): java.security.spec.InvalidParameterSpecException: no constructor found!
W/SecureStoreModule(23138): at com.android.org.bouncycastle.jcajce.provider.symmetric.AES$AlgParamsGCM.localEngineGetParameterSpec(AES.java:462)
W/SecureStoreModule(23138): at com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseAlgorithmParameters.engineGetParameterSpec(BaseAlgorithmParameters.java:24)
W/SecureStoreModule(23138): at java.security.AlgorithmParameters.getParameterSpec(AlgorithmParameters.java:257)
W/SecureStoreModule(23138): at abi22_0_0.host.exp.exponent.modules.api.SecureStoreModule$AESEncrypter.createEncryptedItem(SecureStoreModule.java:429)
W/SecureStoreModule(23138): at abi22_0_0.host.exp.exponent.modules.api.SecureStoreModule$HybridAESEncrypter.createEncryptedItem(SecureStoreModule.java:566)
W/SecureStoreModule(23138): at abi22_0_0.host.exp.exponent.modules.api.SecureStoreModule.setItemImpl(SecureStoreModule.java:132)
W/SecureStoreModule(23138): at abi22_0_0.host.exp.exponent.modules.api.SecureStoreModule.setValueWithKeyAsync(SecureStoreModule.java:93)
W/SecureStoreModule(23138): at java.lang.reflect.Method.invoke(Native Method)
W/SecureStoreModule(23138): at java.lang.reflect.Method.invoke(Method.java:372)
W/SecureStoreModule(23138): at abi22_0_0.com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
W/SecureStoreModule(23138): at abi22_0_0.com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
W/SecureStoreModule(23138): at abi22_0_0.com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
W/SecureStoreModule(23138): at android.os.Handler.handleCallback(Handler.java:739)
W/SecureStoreModule(23138): at android.os.Handler.dispatchMessage(Handler.java:95)
W/SecureStoreModule(23138): at abi22_0_0.com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
W/SecureStoreModule(23138): at android.os.Looper.loop(Looper.java:135)
W/SecureStoreModule(23138): at abi22_0_0.com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
W/SecureStoreModule(23138): at java.lang.Thread.run(Thread.java:818)
Into the code
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (18 by maintainers)
Same in here.
Error: Could not decrypt the item in SecureStore.I tried in
ASUS_Z00ADtoo as same sdk version but couldn’t reproduce the error.The issue happened here when I reinstalled the app .apk or expo app.
Context:
Code:
E_SECURESTORE_DECRYPT_ERRORStack:Same error, after reinstalling app Latest SDK: 27.0.2 Expo app (in development)
Native log:
JS:
This error gets thrown when there’s one of many possible errors in the security implementation the device provides so it’s hard to pin down exactly what it could be. If you can get more precise stack traces that show the issue we can maybe fix it.
We think we know the bug and why it’s affecting just standalone clients. I have a PR up internally and next it needs to be reviewed and merged and then deployed to the standalone app builders so it’ll take sometime but is in motion.