realm-js: Missing Realm constructor. Did you run "react-native link realm"?
2019-10-12 18:12:48.003275+0800 mlmlApp[28520:193898] [] nw_socket_handle_socket_event [C5.1:1] Socket SO_ERROR [61: Connection refused] 2019-10-12 18:12:48.008963+0800 mlmlApp[28520:193898] [] nw_socket_handle_socket_event [C5.2:1] Socket SO_ERROR [61: Connection refused] 2019-10-12 18:12:48.017092+0800 mlmlApp[28520:193888] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection 2019-10-12 18:12:48.017465+0800 mlmlApp[28520:193888] TCP Conn 0x6000020f1680 Failed : error 0:61 [61] 2019-10-12 18:12:48.222 [error][tid:com.facebook.react.JavaScript] Error: Missing Realm constructor. Did you run “react-native link realm”? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting 2019-10-12 18:12:48.226 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Error: Missing Realm constructor. Did you run “react-native link realm”? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting 2019-10-12 18:12:48.253 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) 2019-10-12 18:12:48.256 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
Version of Realm and Tooling
- Realm JS SDK Version: 3.2.0
- Node or React Native: 0.61.2
- Client OS & Version: Mac10.14.6
- Which debugger for React Native: xCode
I have followed the documentation ‘https://realm.io/docs/javascript/latest/#missing-realm-constructor’ but it not work
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 55 (12 by maintainers)
Android is ok
I got it working by: for both iOS AND android
having the auto-linking disabled in the config file
OSX 10.15 RN 0.61.2 REALM 3.2.0
dragged this two XCODE and deleted the test target in RealmJS.xcodeproj
added the libRealmReact.a file in link binaries with libraries
Good day guys.
I am having this error on an android simulator. what’s wrong?
@kneth, so let us know, the developers are waiting for their projects to be developed and so on.
you should add a migration guide for >3.4.0 I’m still trying to figure it out, but it throws error of double symbols or shows
Missing Realm constructorI believe it is related to #2460 - and we are working on it.
“react-native”: “0.61.2”, “realm”: “^3.5.0”,
If run
$ react-native run-ios- its okIf run project in xCode to simmulator - Error: Missing Realm constructor. Did you run “pod install”? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting
If remove folder
ios/buildand again run project in xCode - again Error “Missing Realm constructor” and folderios/buildis emptyUPD: Go to xCode menu
Product -> Clean Build Folder- Yesssss YO!Its work
@rasos We don’t yet support node v12. Try to downgrade to node v10.
I give up, I used version 2.29.1 finally I succeeded
I was able to make it work for me.
dependencies: { “react”: “16.8.6”, “react-native”: “0.60.5”, “realm”: “3.2.0”, // 3.3.0 not working }
In xcode: 2. Add libraries: node_modules\realm\react-native\ios\RealmReact.xcodeproj node_modules\realm\src\RealmJS.xcodeproj
Deal with issue with signing in target RealmJSTests. I choose the Team for Sign certificate, but I think also the option is simple delete this target.
Link binary from pervious added libraries: libRealmJS.a and libRealmReact.a
Thanks this https://github.com/realm/realm-js/issues/2549#issuecomment-539239010 and this https://github.com/realm/realm-js/issues/2460#issuecomment-543905035 messages
I deleted the build directory under the android directory, ran react-native run-android and it cleared up the error.
I fixed it by cleaning the Gradle. Go into the android folder of your react-native app
@rizwanatta Thank you for the recipe.
Downgrading to node 10 allowed me to install realm
https://github.com/realm/realm-js/issues/2582#issuecomment-548282235
ok,thanks ,I will try later