question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS - Missing Realm constructor - please ensure RealmReact framework is included!

See original GitHub issue

When I run I get error (red screen) on iOS emulator Missing Realm constructor - please ensure RealmReact framework is included!

'use strict'
import Realm from 'realm'
{...}
export default new Realm({schema: [WeatherProperty, WeatherStation, WeatherCurrent, WeatherDetail, WeatherTemperature, WeatherTemperatureData]})

Note that I am not getting any error in Android.

My dependencies :

  "dependencies": {
    "react": "^0.14.7",
    "react-native": "^0.22.2",
    "react-native-router-flux": "aksonov/react-native-router-flux#dcc7558",
    "react-native-viewpager": "bosung90/react-native-viewpager#db525c8",
    "react-redux": "^4.4.1",
    "realm": "^0.11.1",
    "redux": "^3.3.1"
  },
  "devDependencies": {
    "redux-devtools": "^3.1.1"
  }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:39 (7 by maintainers)

github_iconTop GitHub Comments

14reactions
Yhozencommented, Jul 18, 2016

I fix it just by adding this two lines in MainApplication.java


import io.realm.react.RealmReactPackage; // ADD THIS
...
  @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new RealmReactPackage() // AND THIS
      );
    }
7reactions
jakeatworkcommented, Nov 10, 2016

here’s a solution that worked for me on el capitan in the simulator:

  1. close all simulators/device builds
  2. stop the package manager running in terminal (or better yet, just restart terminal)
  3. open the ios folder in your app root in finder
  4. go into the build folder (note: you won’t see this build folder in atom, so just right click ios and click open in finder)
  5. delete everything inside of the build folder (just move to trash and keep trash around in case you’re worried)
  6. run react-native run-ios to rebuild the whole thing

it appears when you link new modules, you have to rebuild the build to include it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run Hello World React Native App - Missing Realm ...
When I do that (on device and on emulator), I get: Missing Realm constructor - please ensure RealmReact framework is included! I haven't...
Read more >
Missin Realm Constructor error - MongoDB
Hi, I perfectly followed the instructions that the documentation reported, but every time I start my app it gives me the Missing Realm...
Read more >
Build an Offline-First React Native Mobile App with Expo and ...
Prebuilding our Expo App. On save we'll find this error: Error: Missing Realm constructor. Did you run "pod install"? Please see https ...
Read more >
constructor is not callable react native - You.com
Try importing them in your index.ios.js and index.android.js like this: ... Missing Realm constructor - please ensure RealmReact framework is included!
Read more >
Someone else have tried to implement Realm in an Expo ...
I just add the import in my android project and have this issue. Error: Missing Realm constructor. Did you run "pod install"? Please...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found