Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: Upgrade error InnerNativeModule.installCoreFunctions #846

Closed
xignor opened this issue May 31, 2020 · 59 comments
Closed

V2: Upgrade error InnerNativeModule.installCoreFunctions #846

xignor opened this issue May 31, 2020 · 59 comments
Assignees
Labels
Platform: iOS This issue is specific to iOS 🏠 Reanimated 2

Comments

@xignor
Copy link

xignor commented May 31, 2020

Description

When running the app after 1.8 to 2 upgrade Reanimated throws this error:

Error: Requiring module "node_modules/react-native-reanimated/src/reanimated2/index.js", which threw an exception: TypeError: null is not an object (evaluating 'InnerNativeModule.installCoreFunctions')

Screenshots

image

Steps To Reproduce

  1. Upgrade from1.8.0 to 2.0.0-alpha.1
  2. Update babel.config.js, AppDelegate.h, AppDelegate.mm to reflect changes in https://docs.swmansion.com/react-native-reanimated/docs/installation

Package versions

  • React: 16.11.0
  • React Native: 0.62.2
  • React Native Reanimated: 2.0.0-alpha.1
@terrysahaidak
Copy link
Contributor

Hi. Did you run this with remote debugging enabled?

@xignor
Copy link
Author

xignor commented Jun 1, 2020

@terrysahaidak no, didn't had remote debugging enabled

@terrysahaidak
Copy link
Contributor

What platform do you use?

@xignor
Copy link
Author

xignor commented Jun 1, 2020

@terrysahaidak ios with

Update babel.config.js, AppDelegate.h, AppDelegate.mm to reflect changes in https://docs.swmansion.com/react-native-reanimated/docs/installation

@terrysahaidak
Copy link
Contributor

Ok, this is weird then. Could you try to clean build folder and rebuild your project from XCode?

@xignor
Copy link
Author

xignor commented Jun 1, 2020

@terrysahaidak tried cleared cached on react-native and clean build on XCode, and no avail

@terrysahaidak
Copy link
Contributor

Then the only way to figure this out is to provide reproducing repo.

@xignor
Copy link
Author

xignor commented Jun 22, 2020

@terrysahaidak haven't had had a chance to create a reproducing repo but found that the issue is from adding

    _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:_bridge

to a project using wix/react-native-navigation which uses multiple root views

@jakub-gonet jakub-gonet added Platform: iOS This issue is specific to iOS and removed Bug labels Sep 21, 2020
@piaskowyk
Copy link
Member

This issue should no longer appear. I am not able to reproduce on any stable version. If you still have this problem with the stable version please let me know.

@samrith-s
Copy link

Have this exact same issue with reanimated@v2.3.0-beta.1 when trying to run the app. No idea what to do or fix, cannot create a reproduction repo as our project is extremely complicated. Can you point how to debug this? Where is it trying to find installCoreFunctions? Which file is calling it?

@ericzhou27
Copy link

I'm getting the same issue as @samrith-s but with reanimated@v2.3.0-beta.2, the only version that works with RN 0.66. Any ideas for fixes?

@77TecShaeer
Copy link

+2

@rdbsf
Copy link

rdbsf commented Oct 9, 2021

+1 also with "react-native-reanimated": "2.3.0-beta.2",

@victorzimnikov
Copy link

global.__reanimatedModuleProxy in undefined

@juanjsebgarcia
Copy link

Can we have this issue reopened @jmysliv @piaskowyk? Keeping it closed keeps it buried and it looks like its causing some trouble for RN 0.66

@shobhitsinghal624
Copy link

Started a new issue since this issue is marked as closed #2525

@rafwell
Copy link

rafwell commented Oct 12, 2021

Hi guys. I've found this issue when I upgrade from RN 0.65 to 0.66. I fixed folowing the installation instructions here https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

Well, I don't know why this was working before, but in my project was missing some steps, like enableHermes:true and some overrides.

Now is working like a charm.

"react-native": "0.66.0",
"react-native-reanimated": "^2.3.0-beta.2",

@AHMAD19858
Copy link

i have the same issue
Cannot read property 'installCoreFunctions' of undefined, js engine: hermes

"react-native": "0.66.0",
"react-native-reanimated": "^2.3.0-beta.2",

@AHMAD19858
Copy link

AHMAD19858 commented Oct 12, 2021

i have the same issue Cannot read property 'installCoreFunctions' of undefined, js engine: hermes

"react-native": "0.66.0", "react-native-reanimated": "^2.3.0-beta.2",

it worked with me after adding
plugins: [
'react-native-reanimated/plugin',
]
in babel.config.js
after that npm start --reset-cache

hope it will work with u guys

@samernady
Copy link

samernady commented Oct 14, 2021

was facing same problem
"react-native": "0.66.0", "react-native-reanimated": "^2.3.0-beta.2",

I changed in android/app/build.gradle
project.ext.react = [ enableHermes: true ]

and in the MainApplication.java
I added on top
import com.facebook.react.bridge.JSIModulePackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
and in the function ReactNative Host () I added
@Override protected JSIModulePackage getJSIModulePackage() { return new ReanimatedJSIModulePackage(); }

It worked like a charm

@princefishthrower
Copy link

princefishthrower commented Oct 15, 2021

Note for all arriving here as they upgrade to React Native 0.66.0. You need to implement BOTH comments from @AHMAD19858 and @samernady to get it to work - but the docs link that @rafwell posted has both 😄

@victorzimnikov
Copy link

"react-native": "0.66.0",
"react-native-reanimated": "^2.3.0-beta.2",

:hermes_enabled => true

npm start --reset-cache

android works fine. ios error:
TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes

@Kazi-Yako
Copy link

facebook/react-native#16376 (comment)

This works for me. Thank you!

I am on :

  • react-native": "0.66.4",
  • react: "17.0.2",
  • "react-native-reanimated": "^2.3.0-beta.2",

I changed in android/app/build.gradle:
project.ext.react = [ enableHermes: true ]

In the MainApplication.java:

  1. I added on top:
  • import com.facebook.react.bridge.JSIModulePackage;
  • import com.swmansion.reanimated.ReanimatedJSIModulePackage;
  1. In the function ReactNative Host (), I added:
    @OverRide protected JSIModulePackage getJSIModulePackage() {
    return new ReanimatedJSIModulePackage();
    }

I deleted the node modules (rm -rf node_modules)

I ran yarn start --reset-cache

I ran "Yarn"

cd ios and ran Pod install

yarn run android

@munsifhayat
Copy link

was facing same problem "react-native": "0.66.0", "react-native-reanimated": "^2.3.0-beta.2",

I changed in android/app/build.gradle project.ext.react = [ enableHermes: true ]

and in the MainApplication.java I added on top import com.facebook.react.bridge.JSIModulePackage; import com.swmansion.reanimated.ReanimatedJSIModulePackage; and in the function ReactNative Host () I added @Override protected JSIModulePackage getJSIModulePackage() { return new ReanimatedJSIModulePackage(); }

It worked like a charm

This solution is working fine for M1 as well.

@nabarun1995
Copy link

This issue should no longer appear. I am not able to reproduce on any stable version. If you still have this problem with the stable version please let me know.

TypeError: Cannot read property 'installCoreFunctions' of undefined

i'm getiing this error

@Stephen-L-Wang
Copy link

i changed version of react-native-reanimated to 2.2.4 and it worked

works for me delete '^'

@mrshahzeb7
Copy link

mrshahzeb7 commented Jan 24, 2022

  target.build_configurations.each do |config|
    config.build_settings['OTHER_CPLUSPLUSFLAGS'] = '-DDONT_AUTOINSTALL_REANIMATED'
end

just replaced above code(copied from reanimated documentaion) with below one worked for me

      target.build_configurations.each do |config|
    config.build_settings['OTHER_CPLUSPLUSFLAGS'] = ''
end
  • inShort remove '-DDONT_AUTOINSTALL_REANIMATED' and use '' in pod file

@kaialsh705
Copy link

I am experiencing similar issue and here is my dependencies: "react": "17.0.2", "react-native": "0.66.4", "react-native-reanimated": "^2.3.0",

 BUNDLE  ./index.js

 ERROR  TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions')
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

@hpardess I downgraded my reanimated version specifically to "react-native-reanimated": "2.1.0" without the "^" operator, and it worked. I think other versions up to 2.3.0 works too.

this work for me.

@jdriverab
Copy link

i changed version of react-native-reanimated to 2.2.4 and it worked

It worked too! at least with warns...

TYTY :)

@piaskowyk
Copy link
Member

Same thread here: #2525

@Alavifuentes
Copy link

Alavifuentes commented Feb 9, 2022

Configuraciones de la documentacion
resuelve el problema
"react": "17.0.2",
"react-native": "0.67.2",
"react-native-gesture-handler": "^2.2.0",
"react-native-reanimated": "^2.4.1",
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
image

@mehrannmminaei
Copy link

You must install according to these instructions
Also, make no mistake

Add this code in MainApplication
@OverRide
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage(); // <- add
}

@ybonnetain
Copy link

ybonnetain commented Feb 16, 2022

For wanderers having this issue on iOS (or very similar, something about the JSI module not having the VM reference early on)..
Make sure to init RCTRootView using the appropriate initializer with the help of RCTBridgeDelegate

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
                                          launchOptions:launchOptions];

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                 moduleName:@"MyApp"
                                          initialProperties:initialProps];

Not initWithBundleURL

@yaronlevi
Copy link

@ybonnetain your comment saved me days of work!
I've tried everything but nothing helped.

Becuase we use Codepush we had this line:

let rootView = RCTRootView(bundleURL:jsCodeLocation!, moduleName: "rumble_mobile", initialProperties: nil, launchOptions:launchOptions)

But after changing it to:

let rctBridge = RCTBridge(delegate: self, launchOptions: launchOptions)    
let rootView = RCTRootView(bridge: rctBridge!, moduleName: "rumble_mobile", initialProperties: nil)

The installCodeFunctions error disappered.

I think many people that use CodePush had the same problem. Probably when integrating Codepush you accidentally remove the RCTBridge line and use the other variation of the constructor RCTRootView.

I think this should be added to the docs, just in case.

@siddiquesheikh30
Copy link

I have followed the guide of this comment #846 (comment) and now it is giving me an error as this -
"Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?, js engine: hermes" also this
"Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes" I am using react-native 0.67 please help

@hienbv1312
Copy link

hienbv1312 commented Jun 22, 2022

@yaronlevi you saved my life. THANKS YOU

@roots-ai
Copy link

roots-ai commented Jul 7, 2022

For wanderers having this issue on iOS (or very similar, something about the JSI module not having the VM reference early on).. Make sure to init RCTRootView using the appropriate initializer with the help of RCTBridgeDelegate

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
                                          launchOptions:launchOptions];

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                 moduleName:@"MyApp"
                                          initialProperties:initialProps];

Not initWithBundleURL

This gives this error
Use of undeclared identifier 'initialProps'

@roots-ai
Copy link

roots-ai commented Oct 1, 2022

Tried with

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
                                             launchOptions:launchOptions];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                    moduleName:@"MyApp"
                                             initialProperties:nil];

But now this gives another error and the app doesn't build


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate sourceURLForBridge:]: unrecognized selector sent to instance 0x283b010e0'

Any updates here?

@ybonnetain
Copy link

Tried with

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
                                             launchOptions:launchOptions];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                    moduleName:@"MyApp"
                                             initialProperties:nil];

But now this gives another error and the app doesn't build


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate sourceURLForBridge:]: unrecognized selector sent to instance 0x283b010e0'

Any updates here?

You need to conform to RCTBridgeDelegate in order to use these bridge and view initializers.
See the following gist for a complete example.
https://gist.github.com/ybonnetain/7b3e510050447ae52c0f8d6dd741d9d4

@roots-ai
Copy link

roots-ai commented Oct 1, 2022

@ybonnetain it's giving a compilation error
Use of undeclared identifier '$'

Here is my AppDelegate.m

Stuck on this issue error since months now.

@ybonnetain
Copy link

Line 71, sorry it's @ not $.

But you also need to conform to RCTBridgeDelegate.

You may want to move this issue to stackoverflow and DM me the link ;)

@roots-ai
Copy link

roots-ai commented Oct 1, 2022

@roots-ai
Copy link

roots-ai commented Oct 4, 2022

@ybonnetain Facing issues. InstallCoreFunction seems to crash with another error . com.facebook.react.JavaScript (9): EXC_BAD_ACCESS (code=1, address=0xffffa0000c250698

@rougeEloma
Copy link

was facing same problem "react-native": "0.66.0", "react-native-reanimated": "^2.3.0-beta.2",

I changed in android/app/build.gradle project.ext.react = [ enableHermes: true ]

and in the MainApplication.java I added on top import com.facebook.react.bridge.JSIModulePackage; import com.swmansion.reanimated.ReanimatedJSIModulePackage; and in the function ReactNative Host () I added @Override protected JSIModulePackage getJSIModulePackage() { return new ReanimatedJSIModulePackage(); }

It worked like a charm

hi. i can't find android/app/build.gradle on my pc.

@Aggroid
Copy link

Aggroid commented Oct 21, 2022

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
                                          launchOptions:launchOptions];

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                 moduleName:@"MyApp"
                                          initialProperties:initialProps];

I don't know if you fix it but with the new react-native there is no more initialProperties:initialProps so instead of that use this solution but change initialPropertis:nil .

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
launchOptions:launchOptions];

RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"appName"
initialProperties:nil];

That's how I made it work on react-native 0.68.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS 🏠 Reanimated 2
Projects
None yet
Development

No branches or pull requests