I use Keychain as basic example:
.setGenericPassword('myUserName', 'myPassword')
.then(() => {
console.log('Credentials saved successfully!');
});
but this error happens:

Do you have any idea why ?
on what platform do you have the issue? have you tried following the manual installation instructions to check everything's set up properly? are you using the right package version for your RN version? (there was breaking change for in 0.40 I believe)
@leizard Yes I'm getting a similar error after upgrading to the current version in order to accommodate the breaking changes introduced by RN 0.40
Got a similar error. After updating to RN 0.42.3 and restarting the app with the commands
react-native run-android
react-native start --reset-cache
it is working properly. Was it the restart or the update, i don't know.
I had a similar error, but it was fixed when I restarted using react-native run-ios. My guess is the simulator didn't understand that the new library was linked.
having the same problem. Restart and update didn't work.
using:
"react-native": "0.43.4",
"react-native-keychain": "^1.2.0",
Had this problem, was solved by running
react-native link
react-native run-ios # or run-android
Running this version combo:
"react-native": "0.43.2",
"react-native-keychain": "^2.0.0-rc",
But the issue still existing, after running:
react-native link
react-native run-ios
Any tips for a working combo of RN and RNK? Thanks much!
I am getting same error when calling setGenericPasswordForOptions,My RN version is
"react-native": "0.46.4",
"react-native-keychain": "2.0.0-rc",
But the issue still existing, after running:
react-native link
react-native run-ios.Please give any tips for solving problem
Unable to test to confirm if this will help, but generally my debug process would be to:
node_modules run npm install againreact-native version (don't forget that if you do this you'll probably want to init your entire project again)@wmak ,Thanks for the replay, I had tried all these steps, But getting same error
I am also having the same error.
my RN version is
"react-native": "^0.46.1",
"react-native-keychain": "^2.0.0-rc",
react-native link and rnpm link react-native-keychain. import * as Keychain from 'react-native-keychain';npm run ios where ios is react-native-scripts ios instead of using react-native run-iosindex.ios.js as my entry file... hope someone finds the solution. hello, please check my first comment, especially the part about manual installation (try to install manually)
The only thing that helped me is rebuilding project via Android Studio's _Build_ -> _Rebuild project_ menu item.
Hey @oblador. I think this issue should be closed, it seems to be more a config issue on the client end rather than an issue with this library.
this error goes away after a clean rebuild: rm -rf ios/build && react-native run-ios
@wmak Yup, closing 馃憤
Most helpful comment
Had this problem, was solved by running
read more here