Realm is undefined in React Native Android project


#1

I have followed the installation instruction for React Native in https://realm.io/docs/javascript/latest/
and created the example app below the installation example. I have checked that installation went OK and all the files are modified as described in manual installation steps.

I successfully built and launched the app but my Realm const in const Realm = require('realm'); is empty and therefore open method does not work. I checked on the Android device and emulator

What can be missing? I work in Windows 10


#2

It might be worth checking if the APK file contains the .so files required. An APK file is a ZIP file so you can easily unpackage it.


#3

Thanks for the reply. I just rolled back to Android studio 2.x and it works fine. It looks like realm for React Native is not yet compatible with Android Studio 3.X. Even if you manage to get passed all the build errors it still does not work.

I would advise Realm guys to warn users about it.


#4

@slaval Thanks for the feedback. Do you think it is similar to https://github.com/Microsoft/react-native-code-push/issues/1069?