react-native-rsa-native
react-native-rsa-native copied to clipboard
[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeRsaNative.RSA.generateKeys')]
It does not work with expo-
Errors
[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeRsaNative.RSA.generateKeys')]
at src\utils\pki.ts:11:4 in createKeyPairRSA
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:86:13 in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:66:31 in
I had the same error.
It works just fine after I ran npx expo run:android
and ejected the native config. No other configuration was needed.
Any way of doing this without ejecting?
I had the same error. It works just fine after I ran
npx expo run:android
and ejected the native config. No other configuration was needed.
Could you share more about how to do this? Thank you!
@StrawberryChocolateFudge thank you so much for the tip! It saved my day.
@willpiam you need to run npx expo prebuild
and then run your app using npx expo run:android
. Take a backup of the folder before, just in case.
Is there a way of making it work without ejecting it? In modern Expo, let's say SDK 48/49?
I tried to debug what is actually imported:
import * as RSA from "react-native-rsa-native"
If I log the value of RSA, this is the output:
{"RNRSA": null, "RNRSAKeychain": null, "RSA": null, "RSAKeychain": null, "default": null}
If possible I would like to fix it and submit a PR, if someone can give some guidance
Any updates regarding the null issue without ejecting in expo mentioned by @alessandrocapra ?
I ended up using node-forge instead, it works very well
Alright - will look into it. Thanks.