Skip to content

v12.0.0-alpha.1 Exception in HostObject::get for prop 'Realm': java.lang.NoClassDefFoundError: io.realm.react.RealmReactModule #5666

Closed
@RalissonMattias

Description

How frequently does the bug occur?

Always

Description

When i use new Realm({schema: [TaskSchema]}) the app crashes in android

Stacktrace & log output

Error: Exception in HostObject::get for prop 'Realm': java.lang.NoClassDefFoundError: io.realm.react.RealmReactModule, js engine: hermes
 LOG  Running "realmAlpha1" with {"rootTag":41}
 ERROR  Invariant Violation: "realmAlpha1" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes

Can you reproduce the bug?

Always

Reproduction Steps

  1. npx react-native init projectName
  2. yarn add realm@next
  3. yarn add bson and react-native-get-random-values. Obs: I needed to add these libraries. Without these libraries, the project crashes
  4. Add this line import react-native-get-random-values in App.tsx
  5. Try to use new Realm({schema: [schemas]}). The app crashes in sequence

Version

12.0.0-alpha.1

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android 12

Build environment

System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M2
    Memory: 62.27 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
    Watchman: 2023.02.20.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.0 - /Users/ralissonmattias/.rvm/gems/ruby-2.7.6/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 28, 29, 30, 31, 32, 33
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
      System Images: android-30 | Google Play ARM 64 v8a, android-31 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.5 => 0.71.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Cocoapods version

1.12.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions