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.

TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes

See original GitHub issue

Description

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

Screenshot 2022-08-17 at 13 24 06

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:

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

  1. Clone reproduction repo
  2. Install packages (npm i)
  3. Run the stagingRelease variant (either via Android Studio or via npm run android)
  4. 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:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
benmechencommented, Aug 23, 2022

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:

npx react-native bundle --entry-file index.js --platform android --bundle-output android/app/src/main/assets/index.android.bundle --dev false

fixed the issue with the malformed bundle and resolved the original error.

1reaction
roots-aicommented, Oct 1, 2022

Hey @benmechen!

Can you paste the output of npm ls react-native-reanimated? We suspect there may be two versions of Reanimated installed simultaneously which might be the cause of the issue.

├── react-native-reanimated@2.9.1 overridden
└─┬ react-native-router-flux@4.3.1
  ├─┬ react-navigation-drawer@2.7.2
  │ └── react-native-reanimated@2.9.1 deduped
  └─┬ react-navigation-tabs@2.11.2
    ├── react-native-reanimated@2.9.1 deduped
    └─┬ react-native-tab-view@2.16.0
      └── react-native-reanimated@2.9.1 deduped

I am getting the following output… This looks ok, right? @benmechen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'installCoreFunctions' of undefined, js ...
TypeError : Cannot read property 'installCoreFunctions' of undefined, js engine: hermes.
Read more >
Cannot read property 'installCoreFunctions' of undefined
I am trying to integrate Reanimated 2.0 in iOS React Native swift project and getting the below error. Android App is working fine...
Read more >
Cannot read property 'installCoreFunctions' of undefined, js ...
TypeError : Cannot read property 'installCoreFunctions' of undefined, js engine: hermes. software-mansion/react-native-reanimated. Issue ...
Read more >
Using Hermes - React Native
Hermes is an open-source JavaScript engine optimized for React Native. For many apps, using Hermes will result in improved start-up time, ...
Read more >
Cannot read property 'installCoreFunctions' of undefined-swift
... which threw an exception: TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes. Package Info : "react": "17.0.2",.
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