Standlone android app crashs : Expo encountered a fatal error: null is not an object (evaluating 'y.getRandomBase64')

In order to use WebView from ‘react-native-webview’ I had to import ‘react-native-get-random-values’.
It works fine on the android emulator, but once I expo build:android, the apk crashs,
After trying to analyse in Android Studio :

 java.lang.RuntimeException: Expo encountered a fatal error: TypeError: null is not an object (evaluating 'y.getRandomBase64')

Maybe the react-native-get-random-values lib didn’t get linked or something in the Expo build or …
Thank your for your time

Expo CLI 3.17.24 environment info:
OS: macOS Mojave 10.14.5
Shell: 5.3 - /bin/zsh
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Android Studio: 3.6 AI-192.7142.36.36.6308749
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
expo: ~37.0.3 => 37.0.7
react: ~16.9.0 => 16.9.0
react-native: ~0.61.5 => 0.61.5
expo-cli: 3.17.24

I also had a very similar experience on my app. Runs fine on emulator AND connected phone (android), but crashes with that same null reference when it gets built. Note that I am using a different library. I’m on latest expo versions of everything. I don’t know how to proceed.

My only clue at the moment is I see a warning next to my module import. There are 3 small dots near it with a hover message of

I don’t know if this is a false lead or not. But again, like you, my app runs fine from CLI on the device.

Well, I did eject from Expo … Installed my libs again, now its fine

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.