Open SyedSaifAli opened 1 year ago
@SyedSaifAli Thanks for reporting this. What version of React-Native are you using? Do you have Hermes enabled?
@takameyer I am using react native version 0.68.2
and no Hermes is not enabled.
@SyedSaifAli Can you ensure that RealmJS
is in your xcworkspace when you archive your app for release?
@takameyer No, RealmJS
is not there, although Realm
is present in the Pods.
Am I missing something here?
My screenshot was from v11. We did make changes to how we bind Realm to react-native
in the latest version, so it's possible an upgrade could resolve this issue (also includes support for Hermes). You would, however, need to upgrade react-native
to 0.70
Can you provide the contents of your Podfile? Perhaps something there is causing the issue
@takameyer Sure, here is the Podfile.
# Uncomment the next line to define a global platform for your project
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
target 'app_name' do
config = use_native_modules!
use_modular_headers!
# Pods for app_name
pod 'Realm', '10.32.1'
pod 'Avro-C', '1.7.6'
pod 'GoogleMaps', '3.7.0'
pod 'SocketRocket', '0.5.1'
pod 'IQKeyboardManager'
pod 'Firebase/Crashlytics' # , '4.3.0'
pod 'Firebase/Analytics' #, '6.6.2'
pod 'FirebaseInAppMessaging', '10.3.0-beta'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# use_flipper!()
# post_install do |installer|
# end
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
# installer.pods_project.targets.each do |target|
# if target.name == 'React'
# target.remove_from_project
# end
# end
end
end
Can you remove Realm
from the podfile? This should be auto-linked.
Okay, but I am using Realm in my native(objective c) as well. Shall I be able to use Realm still after removing it from podfile?
@SyedSaifAli Ah, ok. If you are using the cocoa lib as well, then that makes sense to have it in there. Then the question is, is RealmJS
in your generated project? If it's not, then that would make sense that we would see the issue you have submitted.
How do I verify that? Can you help by sharing the steps if possible?
One should be able to just pod install
and see that it's in the Pods folder.
Actually, it won't end up in the Pods
folder, but it should be linked here:
@SyedSaifAli Are you using both RealmJS and RealmSwift in the same app? How/why are you doing this?
@takameyer Ohk, I can see RealmJS in my development Pods
@ianpward The reason for having both RealmJS
and RealmSwift
in the same app is, I have a few screens in my app which are in native(objective c) which requires access to the database so I need RealmSwift on my native side, and there are screens in my app which are in react-native so I need RealmJS in my react-native side as well for functioning.
I'm a bit worried that those are conflicting somehow. Would you be able to test if the issue goes away with those Native screens disabled?
Yeah unfortunately we don't support RealmJS and RealmSwift in the same app - it could be done but you need to match Core Database version numbers - you can find them here: https://github.com/realm/realm-js/blob/master/dependencies.list#L3 https://github.com/realm/realm-swift/blob/master/dependencies.list#L2
@takameyer That's what the problem is, I am not able to reproduce this issue in my development environment or by creating a production app. This is happening with some users within 1 sec of app installation and I am not sure what's the reason of crash. And releasing the app to production by disabling the native screens can't be done
It's very possible. I would expect this to crash in development. Very odd that you are also not able to reproduce it by archiving your application and running it on device. Can you determine if there was a specific version of Realm that this started happening on? It's a bit of a guessing game for us, as we are also not able to produce this. We can only give you recommendations on how to proceed, but cannot guarantee this will solve the issue you are having. It's possible aligning on core versions or using the latest versions of our libraries will fix this.
The last I remember we used version 10.20.0-beta.5
and after that, we started updating to subsequent versions, and this error started coming.
It's strange that the core database version is different but still the app is getting successfully build without any errors.
Although, I am making sure that now the DB version is the same on both the packages and sending a release.
Let's check whether this is solving the problem.
@SyedSaifAli
Let's check whether this is solving the problem.
Any updates to share?
@kneth No, Still the same issue, my current app has the realm js version 10.23.0
and realm-swift pod has version 10.32.1
, still getting crashes.
@takameyer
We can only give you recommendations on how to proceed, but cannot guarantee this will solve the issue you are having
I am open to recommendations, it's just that we are currently not planning for react native upgrade to 0.70, have planned to upgrade it sometime later, however, if there is anything else that you can recommend, I am happy to do it.
this is becoming a pain now, @takameyer please help with what to do to move forward.
hi @SyedSaifAli Product for Realm here. Unfortunately this is not a use case we test for and therefore do not support. I'm sorry about that - we need to do some in-depth research and generate a proposal to support. It is looking like it is going to be a pretty involved project and therefore a long-term project which is currently not on our roadmap. We will be sure to update you when we add it to our project plan.
We are running into this issue as well and it is the top crashes on iOS. We only use Realm-JS (no RealmSwift). We started seeing this issue after upgrading Realm from 10.20.1
to 11.4.0
.
Used Versions:
realm@11.9.0
@realm/react@0.4.1
react-native@0.71.8
We have Hermes enabled in the app. This is a sub-second crash and usually, peaks after we push an update. The error message Error: Missing Realm constructor. Did you run "pod install"? Please see https://docs.mongodb.com/realm/sdk/react-native/install/ for troubleshooting, js engine: hermes
doesn't make sense to us as we always run pod install
before building the app and this doesn't happen to every user.
We have not been able to replicate this issue locally. Here is the JS stack trace.
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, j..., stack:
anonymous@49011:19
loadModuleImplementation@189:13
guardedLoadModule@110:37
metroRequire@42:91
anonymous@48974:28
loadModuleImplementation@189:13
guardedLoadModule@110:37
metroRequire@42:91
anonymous@48935:49
loadModuleImplementation@189:13
guardedLoadModule@110:37
metroRequire@42:91
anonymous@48697:29
loadModuleImplementation@189:13
guardedLoadModule@110:37
metroRequire@42:91
anonymous@1524:38
loadModuleImplementation@189:13
guardedLoadModule@110:37
metroRequire@42:91
anonymous@801:31
loadModuleImplementation@189:13
guardedLoadModule@102:46
metroRequire@42:91
global@424056:3
Here is the native stack trace.
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, js engine: hermes
0 CoreFoundation 0x948c __exceptionPreprocess
1 libobjc.A.dylib 0x15050 objc_exception_throw
2 [Redacted APP_NAME] 0x289b44 RCTFormatError + 167 (RCTAssert.m:167)
3 [Redacted APP_NAME] 0x2efe40 -[RCTExceptionsManager reportFatal:stack:exceptionId:extraDataAsJSON:] + 77 (RCTExceptionsManager.mm:77)
4 [Redacted APP_NAME] 0x2f0684 -[RCTExceptionsManager reportException:] + 147 (RCTExceptionsManager.mm:147)
5 CoreFoundation 0x6dfc0 __invoking___
6 CoreFoundation 0x1f248 -[NSInvocation invoke]
7 CoreFoundation 0x1ede8 -[NSInvocation invokeWithTarget:]
8 [Redacted APP_NAME] 0x2b4180 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 587 (RCTModuleMethod.mm:587)
9 [Redacted APP_NAME] 0x2b6374 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 196 (RCTNativeModule.mm:196)
10 [Redacted APP_NAME] 0x2b5ffc ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 419 (Optional.h:419)
11 libdispatch.dylib 0x637a8 _dispatch_call_block_and_release
12 libdispatch.dylib 0x64780 _dispatch_client_callout
13 libdispatch.dylib 0xa298 _dispatch_lane_serial_drain$VARIANT$mp
14 libdispatch.dylib 0xad70 _dispatch_lane_invoke$VARIANT$mp
15 libdispatch.dylib 0x14dc8 _dispatch_workloop_worker_thread
16 libsystem_pthread.dylib 0x1bd0 _pthread_wqthread
17 libsystem_pthread.dylib 0x1720 start_wqthread
Could this be related to cyclic dependencies in the app? We have a couple of those right now.
I'm also have this exactly error. But I get it after installing the codepush update and only in release mode. I've tried everything, I can't find a fix.
"realm": "12.5.1", "@realm/react": "^0.9.0", "react-native": "0.71.6", "react-native-code-push": "^8.2.1",
@kosbog
From react-native-code-push
:
Note: Any product changes which touch native code (e.g. modifying your AppDelegate.m/MainActivity.java file, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s).
As Realm JS is containing native code, it looks like the combination isn't expected to work.
@kneth I know that. That's why I made a new build for the testflight. And this build had all the latest changes, so it is completely fresh. And this, by the way, also worries me - why does a fresh build receive an update that is already in this code?
@kosbog I have close-to-zero knowledge about react-native-code-push
but I wonder if https://github.com/microsoft/react-native-code-push/issues/2179#issuecomment-1006036747 can help you?
How frequently does the bug occur?
Sometimes
Description
This crash happens with every new install on a device and the app crashes within 1 sec.
RealmJS version :
10.24.0
Pod version:10.32.1
Stacktrace & log output
Can you reproduce the bug?
Sometimes
Reproduction Steps
No response
Version
10.24.0
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
13+
Build environment
I am not able to reproduce this issue on my dev environment, but this is happening with users in production environment
Cocoapods version
10.32.1