Reputation: 1401
According to the latest documentation for MongoDB Realm React Native, it states that their SDK is compatible with Expo...
Expo now supports Realm with the Expo SDK version 44. To use Realm with Expo, upgrade to Expo SDK version 44. Realm does not work with earlier versions of Expo.
We have installed Expo and have the latest version of their SDK, however no matter what we try we get an error stating "Missing Ream Constructor":
We require the project to be in the Expo managed workflow and not the bare workflow. When we setup in bare workflow, it works.
Are we missing something??
Upvotes: 2
Views: 1427
Reputation: 692
Experienced this issue using @realm/react: 0.4.3, realm: 11.8.0
Check your script for building for android in package.json
.
In my case it was expo start --android
, and changing it to expo run:android
fixed the problem (must build app for Realm to work).
This is the command included in the official template for expo-realm found in npm. https://www.npmjs.com/package/@realm/expo-template?activeTab=code
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
....
*haven't checked ios
Upvotes: 0
Reputation: 103
Some of the settings I made to fix:
REMEMBER:
react-native-reanimated
doesn't work with Realm & Expo
Following the documentation
expo start
or npx react-native [platform]
run yarn android
for iOS or yarn ios
npm uninstall -g react-native
and run npx react-native run-android
If you got this error:
A problem occurred configuring project ':realm'.
Could not create task ':realm:compileDebugJavaWithJavac'. Could not create task ':realm:forwardDebugPort'. > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\yourUser\Desktop\Projects\MyAwesomeRealmApp\android\local.properties'. `
To fix this:
local.properties
in android directorysdk.dir=C:\\Users\\UserName\\AppData\\Local\\Android\\sdk
Upvotes: 0