ghbutton / react-native-simple-crypto

A simpler React-Native crypto library
https://www.npmjs.com/package/react-native-simple-crypto
MIT License
42 stars 25 forks source link

Cannot read property 'randomBytes' of undefined #11

Closed Zoey-rahimi closed 4 years ago

Zoey-rahimi commented 5 years ago

I'm getting this error for all of this codes:

const keyArrayBuffer = await RNSimpleCrypto.utils.randomBytes(32); or const ivArrayBuffer = await RNSimpleCrypto.utils.randomBytes(16); also

Cannot read property 'generateKeys' of undefined

const rsaKeys = await RNSimpleCrypto.RSA.generateKeys(1024);

Is anyone knows about this issue? I'm quite new in react native.

JJMoon commented 5 years ago

I got this error. iOS is fine..

> Task :react-native-simple-crypto:compileReleaseJavaWithJavac FAILED
/Volumes/Data/.....my project .../node_modules/react-native-simple-crypto/android/src/main/java/org/walletconnect/crypto/RCTCryptoPackage.java:22: error: cannot find symbol
                new RandomBytesModule(reactContext)
                    ^
  symbol:   class RandomBytesModule
  location: class RCTCryptoPackage
Zoey-rahimi commented 5 years ago

I used this command :

npm i --save-dev tradle/rn-nodeify rn-nodeify --hack --install

But still having some other errors:

`failed to parse node_modules\eslint\node_modules\rxjs\ajax\package.json

failed to parse node_modules\eslint\node_modules\rxjs\internal-compatibility\package.json

failed to parse node_modules\eslint\node_modules\rxjs\testing\package.json

failed to parse node_modules\eslint\node_modules\rxjs\operators\package.json

failed to parse node_modules\eslint\node_modules\rxjs\webSocket\package.json

failed to parse node_modules\grpc\node_modules\protobufjs\examples\protoify\package.json

failed to parse: ...\node_modules\eslint\node_modules\rxjs\internal-compatibility\package.json

failed to parse: ...\node_modules\eslint\node_modules\rxjs\ajax\package.json

failed to parse: ...\node_modules\eslint\node_modules\rxjs\operators\package.json

failed to parse: ...\node_modules\eslint\node_modules\rxjs\testing\package.json

failed to parse: ...\node_modules\eslint\node_modules\rxjs\webSocket\package.json

failed to parse: ...\node_modules\grpc\node_modules\protobufjs\examples\protoify\package.json`

ghbutton commented 4 years ago

Please test on the latest version

ghbutton commented 4 years ago

Going to close, please reopen if there is still an issue