Cannot Write to New Schema Using Realm Sync in React Native

Hello, I tried cloning this repo: https://github.com/mongodb/template-app-react-native-todo (downloaded it as a zip file, uncompressed it and then changed the app id in the atlasConfig.json to match what I have for my example app under app services in MongoDB atlas). I also did a realm-cli login with a private and public API key in the root directory of the project. However, when I try writing data to a schema I want to create called Links, I get the following error:


This is the error in my js server:

 LOG  Running "SyncTutorial" with {"rootTag":1}
 ERROR  Error: Exception in HostFunction: Cannot write to class Link when no flexible sync subscription has been created., js engine: hermes
Error: ENOENT: no such file or directory, open 'C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\JavaScript'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getCodeFrame (C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\node_modules\metro\src\Server.js:1047:18)
    at Server._symbolicate (C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\node_modules\metro\src\Server.js:1133:22)
    at async Server._processRequest (C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\node_modules\metro\src\Server.js:468:7) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\matth\\Documents\\ReactNativeAppDevelopment\\TeeScanVersionFour\\template-app-react-native-todo-main\\JavaScript'
}
Error: ENOENT: no such file or directory, open 'C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\http:\10.0.2.2:8081\index.bundle?platform=android&dev=true&minify=false&app=com.synctutorial&modulesOnly=false&runModule=true'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getCodeFrame (C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\node_modules\metro\src\Server.js:1047:18)
    at Server._symbolicate (C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\node_modules\metro\src\Server.js:1133:22)
    at async Server._processRequest (C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanVersionFour\template-app-react-native-todo-main\node_modules\metro\src\Server.js:468:7) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\matth\\Documents\\ReactNativeAppDevelopment\\TeeScanVersionFour\\template-app-react-native-todo-main\\http:\\10.0.2.2:8081\\index.bundle?platform=android&dev=true&minify=false&app=com.synctutorial&modulesOnly=false&runModule=true'
}

Essentially, the only things I added to the code after downloading the repo and running it are a file titled LinkSchema.tsx that looks like so:

import { BSON } from 'realm';

export class Link extends Realm.Object<Link> {
  _id!: BSON.ObjectId;
  user!: string;
  LinkID!: string;
  originalURL!: string;

  static schema: Realm.ObjectSchema = {
    name: 'Link',
    primaryKey: '_id',
    properties: {
        _id: {type: 'objectId', default: () => new BSON.ObjectId()},
        user: { type: 'string', default: 'matthew.g.2219@gmail.com' },
      LinkID: { type: 'string', default: 'lnk_3dhs_9dCPkpOgUmB' },
      originalURL: 'string',
    },
  };
}

I also changed my RealmContext.ts file to look like so:

import {createRealmContext} from '@realm/react';
import {Item} from './ItemSchema';
import {Link} from './LinkSchema';

export const realmContext = createRealmContext({
  schema: [Item, Link],
});

And in my itemlistview.tsx file, I changed the createItem function to write to my Link schema (I remembered to do an import link from linkschema.tsx at the top of my file). You can see the original function (that works by the way and writes to my cluster: todo->item in MongoDB atlas) that I commented out and the function I wrote that’s not commented out:

// createItem() takes in a summary and then creates an Item object with that summary
  // const createItem = useCallback(
  //   ({summary}: {summary: string}) => {
  //     // if the realm exists, create an Item
  //     realm.write(() => {
  //       return new Item(realm, {
  //         summary,
  //         owner_id: user?.id,
  //       });
  //     });
  //   },
  //   [realm, user],
  // );

  const createItem = useCallback(
    ({summary}: {summary: string}) => {
      // if the realm exists, create an Item
      realm.write(() => {
        return new Link(realm, {
          user: 'mgkid12321@gmail.com',
          LinkID: 'lnklnk',
          originalURL: 'youtube.com',
        });
      });
    },
    [realm, user],
  );

Even after turning developer mode on, I still can’t write to the Links schema. I also tried setting my devices sync to flexible via my app services UI but that didn’t change anything.

I uploaded the repo of the project I’m currently working on to Github so that you can easily navigate my code and tell me where I can modify it to fix this issue: GitHub - MatthewGerges/TeeScan: A react native app that uses Realm Sync to connect to MongoDB

To get realm SDK to work, I also tried downloading the app services zip file from the app services UI but the Zip folder had nothing in it. I also tried using the realm cli to create a template app with a given app id but after creating the app and doing a pull and push command, it gave me the error group not found.

I also tried approaching this problem from a different angle and I followed this tutorial: Build an Offline-First React Native Mobile App with Expo and Realm React Native to create a Realm SDK from scratch. Cloning the repo that this tutorial followed and changing the app id did not work so I decided to follow the webpage step by step and just use the repo as a reference. Everything was going well until I got to the step on “Prebuilding our Expo App.” This is what the section outlines:

Prebuilding our Expo App
On save we’ll find this error:
Code Snippet
1
Error: Missing Realm constructor. Did you run “pod install”? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting
copyIcon
Right now, Realm React Native is not compatible with
Expo Managed Workflows
. In a managed Workflow Expo hides all iOS and Android native details from the JavaScript/React developer so they can concentrate on writing React code. Here, we need to
prebuild
our App, which will mean that we lose the nice Expo Go App that allows us to load our app using a QR code.
The Expo Team is working hard on improving the compatibility with Realm React Native, as is our React Native SDK team, who are currently working on improving the compatibility with Expo, supporting the Hermes JavaScript Engine and expo-dev-client. Watch this space for all these exciting announcements!
So to run our app in iOS we’ll do:
Code Snippet
1
expo run:ios
copyIcon
We need to provide a Bundle Identifier to our iOS app. In this case we’ll use com.realm.read-later-maybe
This will install all needed JavaScript libraries using yarn, then install all native libraries using CocoaPods, and finally will compile and run our app. To run on Android we’ll do:
Code Snippet
1
expo run:android

However, when I do an expo run:android, I get the following error (I tried following advice online to delete node modules and do another npm or yarn install but that didn’t help):

C/C++: ninja: error: manifest 'build.ninja' still dirty after 100 tries

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':expo-modules-core:buildCMakeDebug[armeabi-v7a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanDbSync2\teescandbsynchro2\node_modules\expo-modules-core\android\.cxx\Debug\1v13e6r6\armeabi-v7a'
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/matth/Documents/ReactNativeAppDevelopment/TeeScanDbSync2/teescandbsynchro2/node_modules/expo-modules-core/android/.cxx/Debug/1v13e6r6/armeabi-v7a

  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\matth\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "C:\\Users\\matth\\Documents\\ReactNativeAppDevelopment\\TeeScanDbSync2\\teescandbsynchro2\\node_modules\\expo-modules-core\\android\\.cxx\\Debug\\1v13e6r6\\armeabi-v7a" ^
        expo-modules-core
    from C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanDbSync2\teescandbsynchro2\node_modules\expo-modules-core\android
  ninja: error: manifest 'build.ninja' still dirty after 100 tries

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.

BUILD FAILED in 1m 32s
227 actionable tasks: 35 executed, 192 up-to-date
C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanDbSync2\teescandbsynchro2\android\gradlew.bat exited with non-zero code: 1
Error: C:\Users\matth\Documents\ReactNativeAppDevelopment\TeeScanDbSync2\teescandbsynchro2\android\gradlew.bat exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\matth\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:65:13)
    at Object.onceWrapper (node:events:642:26)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.cp.emit (C:\Users\matth\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
    ...
    at spawnAsync (C:\Users\matth\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:26:19)
    at spawnGradleAsync (C:\Users\matth\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\spawnGradleAsync.ts:83:28)
    at assembleAsync (C:\Users\matth\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\spawnGradleAsync.ts:57:16)
    at actionAsync (C:\Users\matth\AppData\Roaming\npm\node_modules\expo-cli\src\commands\run\android\runAndroid.ts:145:22)

Essentially, all I’m trying to do is to write to MongoDB atlas (my cloud database) from my react native code without having to write a backend in node (I thought RealmSDK would solve this issue for me but I’m having more problems with it than I thought). Ideally, if you could solve the issue I’m experiencing with the repo from my personal github that I shared above, it would be great. Otherwise, telling me why expo run:android in my second app is not working could also help. Also, please provide me with all the code I need to write to my LinksSchema and read a Link from LinksSchema along with any other modifications I need to make to my code (I want to eliminate all the unneeded code from the repo I copied from the react-native template to do application).

Hello @Matthew_Gerges! Sorry you are having issues. Luckily the solution is quite simple. You must subscribe to the Link collection in order to do anything with it (read/write/update). The easiest way to do it would be to configure an initial subscription on the RealmProvider. Alternatively, you can use useRealm within a child component to add a subscription.
Hope this helps! Keep in mind, any model you add to your application will need a subscription in order to access the collection.