Closed marcfrankel closed 1 year ago
@marcfrankel It looks like it is similar to https://github.com/realm/realm-js/issues/4735. Unfortunately we haven't found a solution yet but you mention "related to building the app with Static Frameworks turned on" which is interesting.
Do you see the crash if you use the debug build instead?
@kneth As you can see I commented on that thread, I definitely think they are related. Apologies if I caused a duplicate issue.
To answer your question no I do not see the issue with the debug build. Works fine on the simulator. Pretty sure it worked on a debug build for my physical phone too, but I can check again.
I believe I've isolated it to working with Static Frameworks off even in release, but I'll also kick off a build rn and re-confirm
Okay created a couple of builds. Can confirm that toggling Static Frameworks on and off for me seems to control whether or not it fails.
So to summarize, having Static Frameworks turned on causes RealmJS V 11.0.0-rc.1 to crash my app running Expo 46.0.16 and Hermes. However, the crash only occurs on release builds. In debug mode, it works for simulators and physical devices.
@marcfrankel Could be related to https://github.com/expo/expo/issues/19517?
It very well could be. I was never able to test just static frameworks without Realm Js and the main reason I thought realm was the culprit was that it appeared in the crash logs. However, maybe that's just due to how early realm starts up in the app startup sequence. I'll follow along on these issues. But my guess from looking at those bug reports it likely goes all the way to the top (meaning React Native itself). Not expo. So this fix might be a while.
I'll leave the issue open, and if either you or we see any updates, we can share them.
Experiencing the same issue on production iOS build after installing app
and crashlytics
packages from @react-native-firebase
. The issue output mentions missing Realm constructor
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
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, stack: <unknown>@1268:500 h@2:1707 <unknown>@1267:35 h@2:1707 <unknown>@1266:259 h@2:1707 <unknown>@1265:155 h@2:1707 <unknown>@1261:138 h@2:1707 <unknown>@1257:210 h@2:1707 <unknown>@1133:189 h@2:1707 <unknown>@1132:175 h@2:1707 <unknown>@1131:111 h@2:1707 <unknown>@1078:230 h@2:1707 <unknown>@1077:190 h@2:1707 <unknown>@1019:220 h@2:1707 <unknown>@446:224 h@2:1707 <unknown>@6:57 h@2:1707 d@2:1080 global code@2052:3
Experiencing the same issue on production iOS build after installing app and crashlytics
And it works if these packages are not installed?
It is similar to https://github.com/realm/realm-js/issues/5071.
I wanted to update that it appears to be working now for us with the following combination of stuff:
Expo 47 Hermes Static Frameworks on Realm JS 11.2.0
So I believe we're all good. Thanks to the team for apparently fixing this! Will report back if it regresses
@marcfrankel Thank you for the update. I imagine you are using React Native 0.70.
@kneth Yup, sorry for not specifying. I was implying it through my usage of Expo 47, but I'm on RN version 0.70.5. Also still no issues 🎊
I have a minimal example that reliably reproduces the app crashing on iOS characterized by this issue as well as https://github.com/realm/realm-js/issues/5071 and https://github.com/realm/realm-js/issues/5083.
The particular combination of dependencies:
Steps to reproduce:
Further observations:
Other info about the setup I used to repro the issue:
Sample stack trace on crash (iOS):
* thread #10, name = 'com.facebook.react.JavaScript'
frame #0: 0x0000000110d97fc8 hermes`___lldb_unnamed_symbol6597 + 120
frame #1: 0x0000000110c48310 hermes`___lldb_unnamed_symbol3774 + 112
frame #2: 0x0000000110c174a0 hermes`___lldb_unnamed_symbol3437 + 4016
frame #3: 0x0000000110b42f7e hermes`___lldb_unnamed_symbol1107 + 190
frame #4: 0x0000000110b256a3 hermes`___lldb_unnamed_symbol606 + 723
frame #5: 0x000000010f143c38 ReactNativeIssueRepro`facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) [inlined] facebook::jsi::RuntimeDecorator<facebook::jsi::Runtime, facebook::jsi::Runtime>::call(this=0x0000600001f801d8, f=0x0000700007ece930, jsThis=0x0000700007ece800, args=0x0000700007ece810, count=2) at decorator.h:303:19 [opt]
frame #6: 0x000000010f143c1b ReactNativeIssueRepro`facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::call(this=0x0000600001f801d8, f=<unavailable>, jsThis=<unavailable>, args=<unavailable>, count=<unavailable>) at decorator.h:709:16 [opt]
frame #7: 0x000000010f1c1086 ReactNativeIssueRepro`facebook::jsi::Value facebook::jsi::Function::call<char const (&) [11], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(facebook::jsi::Runtime&, char const (&) [11], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) const + 198
frame #8: 0x000000010f1b113a ReactNativeIssueRepro`realm::js::realmjsi::ObjectWrap<realm::js::ObservableClass<realm::js::realmjsi::Types> >::create_constructor(realm::js::JsiEnv) + 602
frame #9: 0x000000010f1ae1a4 ReactNativeIssueRepro`realm::js::RealmClass<realm::js::realmjsi::Types>::create_constructor(realm::js::JsiEnv) + 36
frame #10: 0x000000010f1ae01e ReactNativeIssueRepro`realm_jsi_init + 142
* frame #11: 0x000000010f18f986 ReactNativeIssueRepro`__24-[RealmReact setBridge:]_block_invoke(.block_descriptor=<unavailable>) at RealmReact.mm:156:11 [opt]
frame #12: 0x000000010f06086b ReactNativeIssueRepro`facebook::react::tryAndReturnError(std::__1::function<void ()> const&) [inlined] std::__1::__function::__value_func<void ()>::operator(this=<unavailable>)() const at function.h:505:16 [opt]
frame #13: 0x000000010f060859 ReactNativeIssueRepro`facebook::react::tryAndReturnError(std::__1::function<void ()> const&) [inlined] std::__1::function<void ()>::operator(this=<unavailable>)() const at function.h:1182:12 [opt]
frame #14: 0x000000010f060859 ReactNativeIssueRepro`facebook::react::tryAndReturnError(func=<unavailable>)> const&) at RCTCxxUtils.mm:74:7 [opt]
frame #15: 0x000000010f055938 ReactNativeIssueRepro`-[RCTCxxBridge _tryAndHandleError:](self=0x00007f8947712c80, _cmd=<unavailable>, block=<unavailable>) at RCTCxxBridge.mm:344:20 [opt]
frame #16: 0x00007ff800c7f5f7 Foundation`__NSThreadPerformPerform + 177
frame #17: 0x00007ff800387035 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #18: 0x00007ff800386f74 CoreFoundation`__CFRunLoopDoSource0 + 157
frame #19: 0x00007ff800386771 CoreFoundation`__CFRunLoopDoSources0 + 212
frame #20: 0x00007ff800380e73 CoreFoundation`__CFRunLoopRun + 927
frame #21: 0x00007ff8003806f7 CoreFoundation`CFRunLoopRunSpecific + 560
frame #22: 0x000000010f05587d ReactNativeIssueRepro`+[RCTCxxBridge runRunLoop](self=<unavailable>, _cmd=<unavailable>) at RCTCxxBridge.mm:335:12 [opt]
frame #23: 0x00007ff800c7f1c3 Foundation`__NSThread__start__ + 1009
frame #24: 0x00007ff834c3d4e1 libsystem_pthread.dylib`_pthread_start + 125
frame #25: 0x00007ff834c38f6b libsystem_pthread.dylib`thread_start + 15
Please let me know if I can provide any other info to help figure this one out (or whether I should open a new issue if this comment doesn't belong here). I appreciate you, Realm team!
I got same issue, app crashed on launching
Using: M1 below dependencies:
"@expo/react-native-action-sheet": "^3.14.0",
"@invertase/react-native-apple-authentication": "^2.2.2",
"@react-native-async-storage/async-storage": "^1.17.7",
"@react-native-clipboard/clipboard": "^1.11.0",
"@react-native-community/geolocation": "^3.0.3",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-picker/picker": "^2.4.4",
"@react-navigation/bottom-tabs": "^6.3.2",
"@react-navigation/drawer": "^6.4.3",
"@react-navigation/native": "^6.0.11",
"@react-navigation/native-stack": "^6.7.0",
"@react-navigation/stack": "^6.2.2",
"@reduxjs/toolkit": "^1.8.3",
"@types/react-native-vector-icons": "^6.4.11",
"expo": "^46.0.0",
"expo-barcode-scanner": "^11.4.0",
"expo-camera": "^12.3.0",
"i18next": "^21.8.14",
"moment": "^2.29.4",
"react": "18.1.0",
"react-i18next": "^11.18.1",
"react-native": "0.70.1",
"react-native-config": "^1.4.6",
"react-native-device-info": "^10.0.2",
"react-native-fast-image": "^8.6.0",
"react-native-fbsdk": "^3.0.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-highlight-word": "^1.0.3",
"react-native-image-crop-picker": "^0.38.0",
"react-native-image-slider": "^1.1.5",
"react-native-inappbrowser-reborn": "^3.7.0",
"react-native-localize": "^2.2.3",
"react-native-permissions": "^3.6.1",
"react-native-ratings": "^8.1.0",
"react-native-reanimated": "^2.9.1",
"react-native-reanimated-carousel": "^3.0.4",
"react-native-restart": "^0.0.24",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.15.0",
"react-native-splash-screen": "^3.3.0",
"react-native-svg": "^13.0.0",
"react-native-ui-action-sheet": "^1.0.3",
"react-native-vector-icons": "^9.2.0",
"react-native-webview": "^11.23.0",
"react-redux": "^8.0.2",
"realm": "^11.3.0"
if i uninstall realm. then run app on real device then app working fine
any solution?
@marcfrankel
Can u please tell me how did you fix this issue I have almost the same combination but still crashes? I have: Expo 47 Hermes enabled Static Frameworks on Realm JS 11.3.0 running on an M1 machine react-native 0.70.6
any update on this ??
I think this issue can be closed. See https://github.com/realm/realm-js/issues/4735.
This issue has been fixed by expo by upgrading to expo@47.0.9
or expo@46.0.19
Just to let you know that this still happens on the latest version.
Install latest version "realm": "^11.4.0" (i.e. "npm i realm") and the app still crashes on iOS. I have downgraded to "realm": "10.9.0" and it worked.
I haven't tested on Android.
When I debugged the app on Xcode I was getting the same error as @klcantrell
Just to let you know that this still happens on the latest version.
Install latest version "realm": "^11.4.0" (i.e. "npm i realm") and the app still crashes on iOS. I have downgraded to "realm": "10.9.0" and it worked.
I haven't tested on Android.
When I debugged the app on Xcode I was getting the same error as @klcantrell
having the same issue on android, did u also downgraded your react native version?
Mine crashes on first realm.write() saw the logcat with debug infos regarding librealm.so and SIGABRT signal Not sure if react reanimated 2 causes any problem just from what i've read on the forums closed gh issues
@FN-FAL113 I will ask you to create a new issue to ensure we get all needed information.
How frequently does the bug occur?
All the time
Description
I have a rather strange bug. It only appears when creating a release build of the ios app. Realm will crash the app right away. I'm using RealmJS version 11.0.0-rc.1 which should be the proper version according to the compatibility matrix. I am on Expo version 46.0.16 and using Hermes.
Local builds work fine, but when I build for release the app crashes instantly on startup. Sadly I produce my release builds through EAS, so getting dsym for the crash log is a little tricky. However, after much fiddling around, I believe the crash is related to building the app with Static Frameworks turned on.
Sadly, I really need this setting enabled as our app also uses React-Native Firebase and enabling Static Frameworks is a requirement for their more recent versions.
Perhaps the compatibility matrix needs updating or I would love to know if you have some sort of workaround or patch I can perform
Stacktrace & log output
Can you reproduce the bug?
Yes, always
Reproduction Steps
Create a release build of the app on EAS 46.0.16, with realm version 11.0.0-rc.1 and static frameworks turned on using the 'expo-build-properties' package. The app will build successfully, but crash on launch.
Version
11.0.0-rc.1
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
ios 15.2
Build environment
Which debugger for React Native: ..
Cocoapods version
No response