skip to Main Content

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


  1. 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
    
    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. 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"];
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search