crypto.getRandomValues() not supported

jsnid00 picture jsnid00 · Apr 12, 2020 · Viewed 8.2k times · Source

I'm getting this error with npm [email protected] when I try to generate a QR code with react-native-qrcode-generator

I'm using react-native with an expo managed workflow. And the thing is it works on iOS, and i only get the error on Android

I searched for a solution myself and I tried installing react-native-get-random-values but that also didn't work.

Any thoughts?

Answer

Ooi Li Ching picture Ooi Li Ching · Apr 12, 2020

I just had the same issue on android. Works fine on iOS.

I solved it with:

  1. Uninstall the existing one npm uninstall react-native-webview
  2. Use expo install react-native-webview instead.