I created an Expo React Native app using the “Quick start with Expo” documentation. I modified the schema and variable names to match my data structure and set up the backend in App Services, also by following the Realm documentation. I set up Flexible device sync as well as the user authentication stuff.
Everything looks good (including log ins) until I try to add a record. The app running in an Android emulator crashes when the code gets to these lines: ('Entry is the name of my schema)
realm.write(() => {
realm.create('Entry', Entry.generate(newEntry, userId));
});
}
I get no error messages in console nor in the Realm logs. The schema definition in the app matches that in the Realm backend.
The following is my package.json
dependencies:
"@realm/react": "^0.3.1",
"expo": "^44.0.6",
"expo-dev-client": "~0.8.4",
"expo-splash-screen": "~0.14.2",
"expo-status-bar": "~1.2.0",
"expo-updates": "~0.11.6",
"react": "17.0.1",
"react-dom": "17.0.2",
"react-native": "0.64.3",
"react-native-get-random-values": "~1.8.0",
"react-native-web": "0.17.1",
"realm": "^10.19.0"
I tried upgrading the packages to the latest version with the same results:
"@realm/react": "^0.3.2",
"expo": "^46.0.2",
"expo-dev-client": "~1.1.1",
"expo-splash-screen": "~0.16.1",
"expo-status-bar": "~1.4.0",
"expo-updates": "~0.14.3",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.3",
"react-native-get-random-values": "~1.8.0",
"react-native-web": "0.18.7",
"realm": "^10.19.5"
I’ve tried simplifying the schema, creating a new app in the Realm backend, and furious web searches with no luck
Thank you!