React Native - Android Bundling failed - useMoralis

My issue is that when I am trying to use Moralis with React Native with Expo while the web version renders just fine the android does not. I am using the exact same method I am using with Next.js and it works fine in the browser, but on mobile, it doesn’t.

I uploaded all the screenshots.
The pic with the test on the top is the web version and the one with the red screen is the android one, rendered at the same time.
I would really appreciate the help as I am unable to resolve this issue.

Hi @mattmorvai

Try to change version of the crypto library to 4.1.1
Because on this version it is not supported by react-native.

Let me know how it will work :raised_hands:

It is currently 1.0.1,
No matching version found for crypto@^4.1.1.

Same issue after adding crypto-js 4.1.1

For me, it seems like Moralis does not currently work with React Native at all.

Our priority was not React Native so we haven’t done much testing here.

1 Like

I did some digging and it turns out that the issue is with React Native Node Modules as crypto is not supported yet

1 Like

Aye. When I try to install the Moralis module into my Expo/React-Native project I get a split dependency on the underlying React version that doesn’t resolve. Near as I can tell you guys are going to have to bump up your React version number before it will work. Let us know. Anxiously awaiting this per our project schedule.

1 Like

In a React Native application you need to import Moralis this way:
const Moralis = require('moralis/react-native.js');

Do I import it to App.js? For me at least it is not clear.

Yes, you need to import it this way

REACT NATIVE SUPPORT IS HERE! https://www.youtube.com/watch?v=FRilwynjW1c

Native apps are installed on the device and can be accessed via icons on the device’s home screen. Native apps are downloaded from an app store (such as Google Play or Apple’s App Store)… They can also include gestures (either standard operating-system gestures or new, app-defined gestures).