software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.83k stars 1.29k forks source link

TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes (RN 0.67.1 + Reanimated v2.3.1) #2917

Closed Sylber23 closed 2 years ago

Sylber23 commented 2 years ago

Description

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

Expected behavior

This error should not occur and the app should start up

Actual behavior & steps to reproduce

App not starting

Reproduce:

  1. Update RN to latest version 0.67.1
  2. Update reanimated to 2.3.1
  3. start app

Snack or minimal code example

https://83hf7.csb.app/

Package versions

name version
react-native 0.67.1
react-native-reanimated 2.3.1
NodeJS 16.10
Xcode 13

Affected platforms

github-actions[bot] commented 2 years ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?

piaskowyk commented 2 years ago

Hey, it looks similar to this issue: https://github.com/software-mansion/react-native-reanimated/issues/2525 This solution should help: https://github.com/software-mansion/react-native-reanimated/issues/2525#issuecomment-1027816444 if it doesn't help, could you provide a repo with reproduction of this issue?

ecosse3 commented 2 years ago

I had the same issue yesterday. Just make sure that you have two imports in MainAppliaction.java for Android and getJSModulePackage() method.

For iOS, if you are using flipper I had some problems after the update and had to downgrade Deployment Version for RCT-Folly, pod update, and rebuild.

Podfile

  use_flipper!()
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
      end

      case target.name
      when 'RCT-Folly'
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
      end
    end
    flipper_post_install(installer)
    react_native_post_install(installer)
  end

Then my app works with Renimated on both platforms.

The app is still crashing in Debug mode on Android but that's another issue related to flipper & reanimated.

Sylber23 commented 2 years ago

I had the same issue yesterday. Just make sure that you have two imports in MainAppliaction.java for Android and getJSModulePackage() method.

For iOS, if you are using flipper I had some problems after the update and had to downgrade Deployment Version for RCT-Folly, pod update, and rebuild.

  use_flipper!()
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
      end

      case target.name
      when 'RCT-Folly'
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        end
      end
    end
    flipper_post_install(installer)
    react_native_post_install(installer)
  end

Then my app works with Renimated on both platforms.

The app is still crashing in Debug mode on Android but that's another issue related to flipper & reanimated.

Thanks a lot, this worked for me as well.

hannojg commented 2 years ago

For future reader, i just want to add that I get that error as soon as I turn on turbo modules arch on iOS