realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.81k stars 577 forks source link

Error: Missing Realm constructor. Did you run "pod install" on iOS #5758

Closed Pingou closed 1 year ago

Pingou commented 1 year ago

How frequently does the bug occur?

Sometimes

Description

Here is another case of this bug. It happens to a few of my users, iOS version doesn't seem to make a difference. Users are upset because they can't even open the app. Compatibility matrix seems to be respected.

Stacktrace & log output

Fatal Exception: RCTFatalException: Unhandled JS Exception: Error: Missing Realm constructor. Did you run "pod install"? Please see https://docs.mongodb.com/realm/sdk/react-native/install/ for troubleshooting
0  CoreFoundation                 0x9e38 __exceptionPreprocess
1  libobjc.A.dylib                0x178d8 objc_exception_throw
2  app                            0x2711c8 RCTFormatError + 167 (RCTAssert.m:167)
3  app                            0x2e4710 -[RCTExceptionsManager reportFatal:stack:exceptionId:extraDataAsJSON:] + 77 (RCTExceptionsManager.mm:77)
4  app                            0x2e4f54 -[RCTExceptionsManager reportException:] + 147 (RCTExceptionsManager.mm:147)
5  CoreFoundation                 0x746b4 __invoking___
6  CoreFoundation                 0x20b1c -[NSInvocation invoke]
7  CoreFoundation                 0x20534 -[NSInvocation invokeWithTarget:]
8  app                            0x29f4b8 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 587 (RCTModuleMethod.mm:587)
9  app                            0x2a149c facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 183 (RCTNativeModule.mm:183)
10 app                            0x2a10ec invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 419 (Optional.h:419)
11 libdispatch.dylib              0x2460 _dispatch_call_block_and_release
12 libdispatch.dylib              0x3f88 _dispatch_client_callout
13 libdispatch.dylib              0xb640 _dispatch_lane_serial_drain
14 libdispatch.dylib              0xc18c _dispatch_lane_invoke
15 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread
16 libsystem_pthread.dylib        0xdf8 _pthread_wqthread
17 libsystem_pthread.dylib        0xb98 start_wqthread

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

11.2.0

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 15, iOS 16

Build environment

npm 6.14.17 node v16.15.1 react-native 0.70.8 realm: 11.2.0 Hermes disabled

Cocoapods version

1.11.3

kneth commented 1 year ago

You mention that it only happens in few cases, and you haven't been able to see a pattern. I wonder if it is a collision with another dependency. It is possible to share package.json?

If the new architecture is enabled, you will have to disable to this old version of Realm.

Moreover, do you have any issues on Android?

kneth commented 1 year ago

We have seen issues like this with react-native-reanimated in the past. And you might have to double-check your package-lock.json if the versions are compatible.

dimitris4 commented 1 year ago

I have the same issue! My package.json file:

"dependencies": { "@react-native-async-storage/async-storage": "^1.17.11", "@react-native-community/netinfo": "^6.0.1", "@react-native-community/push-notification-ios": "^1.10.1", "@react-native-firebase/analytics": "^17.3.2", "@react-native-firebase/app": "^17.3.2", "@react-native-firebase/crashlytics": "^17.3.2", "@react-native-masked-view/masked-view": "^0.2.8", "@react-native-picker/picker": "^2.4.8", "@react-navigation/bottom-tabs": "^6.5.4", "@react-navigation/elements": "^1.3.17", "@react-navigation/native": "^6.1.3", "@react-navigation/native-stack": "^6.9.9", "@sayem314/react-native-keep-awake": "^1.1.0", "@types/react-native": "^0.71.2", "@types/react-native-snap-carousel": "^3.8.5", "base-64": "^1.0.0", "buffer": "^5.4.3", "d3": "^7.8.2", "d3-array": "^3.2.2", "d3-scale": "^4.0.2", "dayjs": "^1.11.7", "deprecated-react-native-prop-types": "^4.0.0", "i18n-js": "^3.8.0", "lottie-react-native": "^5.1.5", "progress-circle-react-native": "^1.0.2", "prop-types": "^15.8.1", "react": "18.2.0", "react-native": "0.71.1", "react-native-android-location-enabler": "^1.2.2", "react-native-ble-manager": "^8.8.0", "react-native-calendars": "^1.1293.0", "react-native-chart-kit": "^6.12.0", "react-native-charts-wrapper": "^0.5.11", "react-native-config": "^1.5.0", "react-native-country-picker-modal": "^2.0.0", "react-native-date-picker": "^4.2.8", "react-native-device-info": "^10.3.0", "react-native-extra-dimensions-android": "^1.2.5", "react-native-flexi-radio-button": "^0.2.2", "react-native-gesture-handler": "^2.9.0", "react-native-get-random-values": "^1.8.0", "react-native-health": "^1.13.6", "react-native-hide-with-keyboard": "^1.2.1", "react-native-iap": "^7.0.0", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-linear-gradient": "^2.6.2", "react-native-localize": "^2.2.5", "react-native-messages": "^0.3.0", "react-native-modal-selector": "^2.1.2", "react-native-pager-view": "^6.1.2", "react-native-permissions": "3.6.1", "react-native-phone-number-input": "^2.1.0", "react-native-progress": "^5.0.0", "react-native-push-notification": "^8.1.1", "react-native-rate": "^1.2.12", "react-native-safe-area-context": "^4.5.0", "react-native-screens": "^3.20.0", "react-native-slider": "git+https://github.com/aerofit/react-native-slider.git", "react-native-sound": "^0.11.2", "react-native-splash-screen": "^3.3.0", "react-native-static-safe-area-insets": "^2.2.0", "react-native-svg": "^13.8.0", "react-native-swipe-gestures": "^1.0.5", "react-native-swiper": "^1.6.0", "react-native-video": "^5.2.1", "react-native-webview": "^11.26.1", "react-redux": "^8.0.5", "realm": "^11.4.0", "redux": "^3.7.2", "redux-ignore": "^1.2.5", "redux-logger": "^3.0.6", "redux-persist": "^6.0.0", "redux-saga": "^1.2.2", "reselect": "^4.1.7", "rn-conical-gradient-progress": "^0.0.2", "rn-tooltip": "^3.0.3", "uuid": "^8.3.2" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native-community/eslint-config": "^3.0.0", "@tsconfig/react-native": "^2.0.2", "@types/enzyme": "^3.10.4", "@types/jest": "^29.2.1", "@types/react": "^18.0.24", "@types/react-native-push-notification": "^8.1.1", "@types/react-test-renderer": "^18.0.0", "@types/redux-mock-store": "^1.0.1", "babel-eslint": "^10.0.2", "babel-jest": "^29.2.1", "babel-preset-react-native": "^4.0.1", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.15.1", "enzyme-to-json": "^3.4.3", "eslint": "^8.19.0", "eslint-plugin-react": "^7.14.3", "eslint-plugin-react-native": "^3.7.0", "jest": "^29.2.1", "jest-serializer-enzyme": "^1.0.0", "metro-react-native-babel-preset": "0.73.7", "prettier": "^2.4.1", "react-addons-test-utils": "^15.6.2", "react-dom": "^18.2.0", "react-native-svg-transformer": "^0.13.0", "react-native-typescript-transformer": "^1.2.13", "react-test-renderer": "18.2.0", "redux-mock-store": "^1.5.4", "sinon": "^7.5.0", "ts-jest": "^24.2.0", "typescript": "4.8.4" }

takameyer commented 1 year ago

Can you provide a repo that reproduces this issue?

kneth commented 1 year ago

I am closing the issue due to no reply back. Please create a new issue if you have new observations to share.