react-native-reanimated: Reloading Via React Native Debug Menu Causes Crash when Realm is installed
Description
Looks like another incarnation of https://github.com/software-mansion/react-native-reanimated/issues/1285
Was happening on my project when tried to add reanimated 2 (just plainly calling <Animated.View />
). I’ve tracked it down to a possible conflict with another dependancy: realmjs.
Below are the steps to reproduce it from reanimated 2 playground
Screenshots
Steps To Reproduce
- checkout reanimated 2 playground
- upgrade react native to 0.63.3
- add realm:
yarn add realm
npx pod-install
- run in simulator and try to refresh with cmd+R
Package versions
- React: 16.13.1
- React Native: 0.63.3
- React Native Reanimated: 2.0.0-alpha.8
- NodeJS: v14.9.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 13
- Comments: 26 (1 by maintainers)
We’re in the process of removing realm-js, mainly due to lack of Hermes support and this is another…
These lines are causing the crash:
I guess both modules are tinkering somewhat with JSI and are causing this problem.
I’ve added the following lines to
Podfile
to prevent the app from crashing upon reload (in our case temporarily). Should be used with care though! As obviously something is going wrong on either Realm or Reanimated v2’s side and this error hints towards a memory issue/leak. TheNDEBUG
flag within theRealm-jsi
module is only used for reference counting.I’m still getting this issue with version @3.1.0 and react native @0.71.7. Anyone know of a solid fix?
Have the same problem, is there any workaround or planned fix for this? Thanks.
Seems like the problem with Realm was resolved. I’ll close this issue. Please let me know if that’s not the case.
@arinjay Please open a new issue since it’s not directly related to Realm being installed. In addition to things you provided please post full crash info as well and repro example if possible. Thanks!
The workaround is not that great though. It mostly suppresses the fact that there is a memory leak I’m afraid. But in day-to-day development where a full reload happens often it makes life a bit more enjoyable…
We migrated to sqlite for the reason it’s proven stable and well maintained. Come to think of it… could be a nice next project of software-mansion to wrap their head around! A lean db solution with a proper API (realm comes close to this)… 👍
Same here… I came across the issue while trying to use react-native-draggable-flatlist. I posted an issue there and someone suggested to upgrade realm to the rc version, which currently should be 11.0.0-rc.2. I gave it a try but that didn’t help unfortunately 😦 the app didn’t even start after the update…
@jakub-gonet can you please reopen this issue?
This bug is still open 😕 I just had the issue with the version 10.21.1, if someone knows how to fix without the workaround of @mattijsf please let me know, and thanks mattjsf
We’ve released a new version of Realm JS with support for the Hermes engine: Realm JS v10.20.0-alpha.2.
Please take it for a spin and provide any feedback or issues you might have using the Hermes issue template over at the Realm JS repository. Thanks for your patience!