TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes
See original GitHub issueDescription
When running on Android (issue does not occur on iOS) in release mode only, we get the below error:
E/ReactNativeJS: TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes
This does not occur when running in debug mode, so is only affecting our release builds distributed to testers and users. We have followed the suggested steps in the similar issue threads (#2525, #846, #3420), including:
- Adding plugin to babel.config.js
- Resetting metro cache
- Ensuring installation instructions have been followed correctly
However most of these issues are iOS only - our issue is the opposite, iOS runs fine but Android does not.
We have created a reproduction app by stripping everything but react-native-reanimated out of our main app.
We did recently upgrade from RN 0.64 to 0.68, however this was done a couple weeks before we saw this issue. There have been no changes since that would have an effect on this library that we are aware of. We have also tried both upgrading and downgrading the library (2.4.x and 3.0.0-rc.1) with no success.
Steps to reproduce
- Clone reproduction repo
- Install packages (
npm i
) - Run the
stagingRelease
variant (either via Android Studio or vianpm run android
) - The app will crash on startup, and an error will be logged in Android Studio only
Snack or a link to a repository
https://github.com/chelsea-apps/reanimated-repro
Reanimated version
2.9.1
React Native version
0.68.2
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Release mode
Device
Android emulator
Device model
Pixel 3A API 32
Acknowledgements
Yes
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Closing this @tomekzaw, turns out to not be an issue with this library directly, instead it was an issue with RN itself. Thanks for your help.
For anyone else with this issue, here’s how I solved it: @tomekzaw’s original comment regarding there possibly being multiple versions made me think. Whilst there was only one version installed in node_modules (and as such the dev build of the app), when the app is built for release all JS is bundled into index.android.bundle.
I had a dig into this and it seems to not have been generated correctly (seems to be an ongoing RN issue). Presumably the RN CLI caches bundles to save build time, and it had cached an old version of the bundle with an old version of Reanimated. When we then updated Reanimated, the two bundled versions were conflicting, causing this issue.
Removing the cached bundle (which was in source control but I’ve now removed), and manually generating it using:
fixed the issue with the malformed bundle and resolved the original error.
I am getting the following output… This looks ok, right? @benmechen