Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RJSInitializeInContext EXC_BAD_ACCESS on launch #3831

Closed
mitaxe opened this issue Jul 6, 2021 · 2 comments
Closed

RJSInitializeInContext EXC_BAD_ACCESS on launch #3831

mitaxe opened this issue Jul 6, 2021 · 2 comments

Comments

@mitaxe
Copy link

mitaxe commented Jul 6, 2021

I am trying to use Realm in my RN application, but I get a crash on a splash screen (provided in the 'Actual Results" section).
DB is not even used. I moved initialization to the initDatabase method that I am not calling from code. Code snippet is attached at the very end.

Goals

Realm works on iOS

Expected Results

Realm works on iOS

Actual Results

Steps to Reproduce

  • yarn install
  • cd ios && pod install

Code Sample

Version of Realm and Tooling

  • Realm JS SDK Version: 10.5.0
  • Node or React Native: React Native 0.64.1
  • Client OS & Version: ? iPhone X, iOS 14.6
  • Which debugger for React Native: ? None
import Realm from 'realm'
import { Playlist } from './playlist'

class Database {
  realm: Realm
  playlist: Playlist

  public initDatabase() {
    try {
      this.realm = new Realm({
        schema: [Playlist],
        inMemory: true,
        schemaVersion: 1.0,
      })

      console.log('path', this.realm.path)
      this.playlist = new Playlist()
    } catch (err) {
      const { message } = err as Error
      console.error('Failed to open the realm', message)
    }
  }

  //TODO: Specify data type. It will exist in playlist store.
  public addPlaylist(data: any): void {
    this.playlist.addPlaylist(this.realm, data)
  }

  public getPlaylists(): Realm.Results<Realm.Object> {
    return this.playlist.getPlaylists(this.realm)
  }

  // public getPlaylistExercises(playlistId: number) {
  //   return this.playlist.getExercises(playlistId)
  // }

  public closeConnection() {
    this.realm.close()
  }
}

export default new Database()

@mitaxe
Copy link
Author

mitaxe commented Jul 6, 2021

it happens because we are using Hermes in iOS. I think it should be mentioned somewhere in the readme that realm doesn't support hermes.

@kneth
Copy link
Contributor

kneth commented Jul 7, 2021

We are working on Hermes - see #3792 - but in the meantime it might be a good idea to issue a warning in README.md.

@sync-by-unito sync-by-unito bot closed this as completed Jul 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants