Closed ortonomy closed 2 years ago
Getting the same issue when using with nanoid
and have to switch to another library because of that issue.
What is the RN version? I am going to use it on RN 0.63.2.
@emclab it should work with 0.63.2 👌
If someone could post a repo with a React Native project where this doesn't work I would be happy to take a look!
I'm getting this error:
Possible Unhandled Promise Rejection (id: 0):
Error: Native module not found
Error: Native module not found
at getRandomBase64 (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.abc&modulesOnly=false&runModule=true:312682:22)
at getRandomValues
Macbook M1 Air Pro: 2021 React Native: 0.65.1 react-native-get-random-values: 1.7.0
@btd1337 did you run npx pod-install
in your project after installing this package?
I'm encountering a similar issue. @LinusU - I definitely ran npx pod-install
, and while I can clearly see the podspec file in my node_modules
directory, it doesn't seem to be present in the Podfile.lock
after I run the install.
I was able to remedy the issue by explicitly referring to the directory in my Podfile
:
pod 'react-native-get-random-values', :path => '../node_modules/react-native-get-random-values/'
... after which I'll see a line like this in the output:
Installing react-native-get-random-values (1.7.1)
Not at all sure why that's happening!
npm i react-native-get-random-values
cd ios && pod install
quit the current project and added import 'react-native-get-random-values' at the top of index.js
and then react-native run-ios -- --reset-cache
Happy to reopen if people are still having problems, but I don't have enough information to debug this. Creating a new React Native project and adding this module works for me...
same here; tried everything, got error
ERROR [Error: Native module not found]
same here; tried everything [...]
"Tried everything" doesn't really give me much to work with. Did you try to create a new clean React Native project and adding this module?
I was having the same issue but for Android. I solved it by following these steps:
-> added import react-native-get-random-values'
beneath import App from './App'
in index.js
-> confirmed it was defined in my package.json and up to date
-> gradle clean
-> react-native run-android
-> react-native start --reset-cache
Hi all am still getting same error. Can anyone help me.
This is really buggy for me while I'm doing react-native development. It only works when remote debugging.
On physical device and simulator.
I can't give further information, because I don't know what you need.