11

I am trying to integrate Reanimated 2.0 in iOS React Native swift project and getting the below error. Android App is working fine but not get the solve for iOS.

https://docs.swmansion.com/react-native-reanimated/docs/

Error: Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes

Package Info :

"react": "17.0.2",

"react-native": "0.67.0",

"react-native-reanimated": "2.3.1"

Hermes is Enabled.

Babel plugin is set for reanimate

Done multiple time node_module clear and cache reset.

3 Answers 3

2

you have not done plugin config, in this case it looks like BABEL problem

please read => https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation

make sure you done all there, if u done all from this and still not working then try

npm:

npm start --reset-cache

yarn:

yarn start --reset-cache

if still ... then remove "node_modules" and redownload them by "yarn" or "npm" ( if u r on mac and doing ios development u have to "cd ios && pod install" )

rm -rf node_modules
5
  • 1
    Done all of this. But still not luck. Jan 23, 2022 at 6:34
  • then there is 1 more hthing remove again node modules package and do all as admin, if node doesnt have rights then scripts inside node_modules cant execute correct
    – Engazan
    Jan 23, 2022 at 12:40
  • Tried, but still its the same error. Feb 2, 2022 at 13:34
  • Didnt work for me. Also - error Im getting when building in Android Studio is "Task 'assembleDebug' not found in project ':react-native-reanimated" Mar 6, 2022 at 5:01
  • Also - error doesnt occur with RN 0.66.0 Mar 6, 2022 at 5:08
1

Did you add Reanimated's babel plugin to your babel.config.js? Like so:

  module.exports = {
      ...
      plugins: [
          ...
          'react-native-reanimated/plugin',
      ],
  };

There can also be a permission error, try running chmod +rwx ./node_modules

2
  • Plugin was already added.. Tried with permission but still the same error. Feb 2, 2022 at 13:33
  • Same for me...plugin added and no luck Mar 6, 2022 at 5:02
0

I was using initWithBundleURL to initialise the the rootView I changed it to initWithBridge which helped me resolve the issue.

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
                                            launchOptions:launchOptions];
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"appname"
                                            initialProperties:initialProps ];

You might have to implement sourceURLForBridge something like this

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.