realm-js: Realm Crashes on App Startup [React-Native]

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

Sadly this is non-symbolicated:
Thread 12 Crashed:
0   libsystem_kernel.dylib        	       0x1ddbfa200 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x1ede371ac pthread_kill + 268
2   libsystem_c.dylib             	       0x1a8a493f4 __abort + 128
3   libsystem_c.dylib             	       0x1a89f1cac abort + 192
4   libc++abi.dylib               	       0x1edd79b8c abort_message + 132
5   libc++abi.dylib               	       0x1edd69a80 demangling_terminate_handler() + 336
6   libobjc.A.dylib               	       0x19a8d9eec _objc_terminate() + 144
7   SaidThatDEV                   	       0x104aa75d4 0x104474000 + 6501844
8   libc++abi.dylib               	       0x1edd78f28 std::__terminate(void (*)()) + 20
9   libc++abi.dylib               	       0x1edd7becc __cxa_rethrow + 148
10  libobjc.A.dylib               	       0x19a8d5854 objc_exception_rethrow + 44
11  CoreFoundation                	       0x1a15892a8 CFRunLoopRunSpecific + 808
12  SaidThatDEV                   	       0x104f58d10 0x104474000 + 11422992
13  Foundation                    	       0x19b9a6ce8 __NSThread__start__ + 716
14  libsystem_pthread.dylib       	       0x1ede316cc _pthread_start + 148
15  libsystem_pthread.dylib       	       0x1ede30ba4 thread_start + 8

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 22 (10 by maintainers)

Most upvoted comments

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

I think this issue can be closed. See https://github.com/realm/realm-js/issues/4735.

@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 🎊