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.

Realm Crashes on App Startup [React-Native]

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
thecoorumcommented, Nov 2, 2022

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
1reaction
marcfrankelcommented, Nov 18, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashes after using useQuery or Realm.objects()
Hello friends I come to ask for help because I'm developing an application using React Native, Expo and Realm and I got stuck...
Read more >
Realm: create causing a crash within android (react-native)
The example below is working fine while in debug is enabled using React Native Debugger but the app is crashing in normal ...
Read more >
In iOS 15, when the app is restarted, it immediately crashes.
The app sometimes crash on startup, and then work again just afterwards. The app shows splashscreen, then quickly fades to a blurred home...
Read more >
Using Hermes - React Native
This will compile JavaScript to bytecode during build time which will improve your app's startup speed on device.
Read more >
[Solved]-Apk crashes after adding realm to react native-React ...
Related Query · Apk crashes after adding realm to react native · React Native ScrollView Crashes on Android APK · App crashes on...
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