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

TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions') #2525

Closed
2 of 3 tasks
shobhitsinghal624 opened this issue Oct 11, 2021 · 32 comments
Labels

Comments

@shobhitsinghal624
Copy link

Description

App crashes with this error:

TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions')

Expected behavior

App should not crash.

Actual behavior & steps to reproduce

NA

Snack or minimal code example

NA

Package versions

  • React Native: 0.66
  • React Native Reanimated: 2.3.0-beta.2
  • NodeJS: v14.17.6
  • Xcode: 13
  • Java & Gradle: latest

Affected platforms

  • Android
  • iOS
  • Web

image

@github-actions
Copy link

Issue validator

The issue is valid!

@piaskowyk
Copy link
Member

Hey @shobhitsinghal624 👋
Could you provide a repo with an example app to reproduce this issue? Please 🙏 without this, I can't fix it :/

@mjmasn
Copy link

mjmasn commented Oct 12, 2021

I'm taking a look a reproducing this with a fresh RN app 👍🏻 will report back soon!

@mjmasn
Copy link

mjmasn commented Oct 12, 2021

In the meantime here is my npx react-native info output:

❯ npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 11.3
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 214.94 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.0.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 13.0/13A233 - /usr/bin/xcodebuild
  Languages:
    Java: javac 17 - /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.66.0 => 0.66.0
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

@mjmasn
Copy link

mjmasn commented Oct 12, 2021

Seems ok on a fresh React Native 0.66 app npx react-native init ReanimatedIssue2525 --template react-native-template-typescript.

Initially had a bunch of build errors on a fresh Salesforce SDK / React Native 0.66 app forcereact createwithtemplate --templaterepouri=ReactNativeTypeScriptTemplate but that also worked with a few modifications.

Wonder if it's an interaction with some other package... only happening for us on iOS though. Is that the case for you as well @shobhitsinghal624 or is it crashing on Android too?

@mjmasn
Copy link

mjmasn commented Oct 12, 2021

Sorry I take that back, this does error with the Salesforce SDK-generated app, both on Android and iOS just by importing import Animated from 'react-native-reanimated' in index.js. Maybe they didn't upgrade their template correctly for RN 0.66...

@gavrichards
Copy link

I get this too on Android, since updating to 2.3.0-beta.2 (which was necessary due to updating to React Native 0.66.0).

The console log on startup of the app is:

BUNDLE ./index.js

WARN new NativeEventEmitter() was called with a non-null argument without the required addListener method.
WARN new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.
WARN new NativeEventEmitter() was called with a non-null argument without the required addListener method.
WARN new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.
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.
LOG NotificationHandler: {"os": "android", "token": "cgmdKLcaRN2F3scqi7W8-n:APA91bE2w6VXcx6zNO1LJa3wb8HpSuj_XPeUQmr_FLfuA05U1yiZMTcKWDPxmDrdnceFhrnfbo2zQ14ecZGwgROM-xvTDpEu9W6RC6cF-KBiqxhsi5XHizQTxTPug2pJqNPqKbuL-opZ"}
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.

@mjmasn
Copy link

mjmasn commented Oct 12, 2021

@piaskowyk OK so it looks like some changes were made in React Native version 0.58.6 (three years ago!!) that in our case were missing from our AppDelegate.h / AppDelegate.m. We actually generated these using Salesforce's forcereact CLI tool so I think they might need to update their templates 😂 No more crash on start for us now 🎉

@gavrichards and anyone else still seeing this issue, do you follow the upgrade helper every time you upgrade React Native?

You can see the changes I mean here in AppDelegate.h / AppDelegate.m: https://react-native-community.github.io/upgrade-helper/?from=0.58.6&to=0.66.0

Must be some similar changes on the Android side that we'd already made.

@gavrichards
Copy link

@mjmasn yes, I follow it to the letter, every time.
Which specific changes are you referring to?

@gavrichards
Copy link

I've figured it out - there are some steps in the installation docs that must not have been there when I initially installed this package.
Step 2 here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/#android
My app is now starting up successfully. Thanks for the nudge @mjmasn.

@harrymash2006
Copy link

Hi guys, anyone got this fixed ?

@samrith-s
Copy link

samrith-s commented Nov 9, 2021

I have followed all the steps, but things are still not working. It works on Android, but doesn;t work on iOS. What am I missing?

info Fetching system and libraries information...
System:
    OS: macOS 11.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 920.34 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.3.0 - /var/folders/y_/gy00qtms2kq6v3380xs2k1cm0000gq/T/yarn--1636477167680-0.13777315466882145/node
    Yarn: 1.22.11 - /var/folders/y_/gy00qtms2kq6v3380xs2k1cm0000gq/T/yarn--1636477167680-0.13777315466882145/yarn
    npm: 7.15.1 - ~/.nvm/versions/node/v16.3.0/bin/npm
    Watchman: 2021.08.30.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
      System Images: android-25 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.2 AI-202.7660.26.42.7351085
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.66.2 => 0.66.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Reanimated version: 2.3.0-beta.2

I keep getting this error:

ERROR  TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes
ERROR  Error: Requiring module "d11-app/src/components/DummyNotification.tsx", which threw an exception: TypeError: Cannot read property 'installCoreFunctions' of undefined, js engine: hermes

I did some digging and

@crstian
Copy link

crstian commented Nov 15, 2021

I think I figured it out. In my case it worked on Android, but didn't work on iOS. It is now working fine.

I followed all the installation steps here - and therefore turned off autoinstall by mistake:

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

After removing the compilation flag DONT_AUTOINSTALL_REANIMATED again, it worked. Please make sure to re-install your pods and clean your npm cache.

Hope that helps!

@enaqx
Copy link

enaqx commented Nov 16, 2021

I do expereince the same issue, but in my case it fails for App Clip https://developer.apple.com/app-clips/ iOS target. It works for ordinary iOS target.

Here is my Pofdile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'UnrollMe' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'Unroll.me' do
    inherit! :complete
  end
end

and react-native info

info Fetching system and libraries information...
System:
    OS: macOS 11.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 487.94 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.0 - ~/.nvm/versions/node/v14.18.0/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 23, 24, 25, 26, 28, 29
      Build Tools: 28.0.3, 29.0.2, 29.0.3
      System Images: android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 16.0.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.66.0 => 0.66.0 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

@AdamTyler
Copy link

I'm also running into this issue on iOS. Android is working fine. This is after following all the documented install steps.
react-native 0.66.3
react-native-reanimated 2.3.0-beta.4

TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions')

@AdamTyler
Copy link

I spent a few hours debugging this and my issue was very specific and might not apply to everyone but as a data point:

The issue I ran into was my AppDelegate main class was extending NSObject instead of the react native default UIResponder.
Making that change resolved my issue.

@michaelbayday
Copy link

having issue with a project using the brownfield library on ios. we were able to adapt the solution to get it to work on android, but since we dont have a traditional greenfield repo setup is it possible that the script to setup turbo modules not working?

@fuekiin
Copy link

fuekiin commented Dec 22, 2021

Running into the same Issue trying to use reanimated within a Swift Framework.

@hugosbg
Copy link

hugosbg commented Dec 24, 2021

I temporarily resolved that way

downgrade from 2.3.1 to 2.2.4

yarn remove react-native-reanimated
yarn add [email protected] -E

and with these installation instructions: https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation

my environment is like this

"react": "17.0.2",
"react-native": "0.66.4"
"react-native-reanimated": "2.2.4"
...

@daheeahn
Copy link

I temporarily resolved that way

downgrade from 2.3.1 to 2.2.4

yarn remove react-native-reanimated
yarn add [email protected] -E

and with these installation instructions: https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation

my environment is like this

"react": "17.0.2",
"react-native": "0.66.4"
"react-native-reanimated": "2.2.4"
...

Thx!!!

@piaskowyk
Copy link
Member

Has anyone got this issue still?

@piaskowyk piaskowyk self-assigned this Dec 29, 2021
@TomasSestak
Copy link

Has anyone got this issue still?

Yep after I downgraded to 2.2.0, because getting weird bugs on newest version but Expo notifies that I need to update. When I update its ok tho

@piaskowyk
Copy link
Member

@TomasSestak could you provide me a repo to reproduce the issue? It helps me a lot! 🙏

@piaskowyk piaskowyk added Unable to repro Missing repro This issue need minimum repro scenario labels Dec 29, 2021
@charity-detalytics
Copy link

@piaskowyk How about this https://codesandbox.io/s/reanimated2playground-83hf7?

@sumit-badsara
Copy link

I've figured it out - there are some steps in the installation docs that must not have been there when I initially installed this package. Step 2 here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/#android My app is now starting up successfully. Thanks for the nudge @mjmasn.

Just follow this guide:
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/#android

Thanks @gavrichards @mjmasn

@piaskowyk
Copy link
Member

@charity-detalytics

@piaskowyk How about this https://codesandbox.io/s/reanimated2playground-83hf7?

To resolve this issue on the web you should update reanimated to 2.3.1

@piaskowyk
Copy link
Member

The most probable causes of this issue are:

@piaskowyk
Copy link
Member

If this doesn't help please provide me a repo to reproduce the issue and we will fix it.

@rohitjindal018
Copy link

The most probable causes of this issue are:

Tried the above, still doesn't work. Trying to setup renanimated2 with swift. Have tried with both (with and without CPP flag). still getting installCoreFunctions is undefined. global.__reanimatedModuleProxy is not getting set.

@charity-detalytics
Copy link

#1439 (comment) works for me.

@rohitjindal018
Copy link

#1439 (comment) works for me.

Worked like a charm for me. Thanks

@frankbolviken
Copy link

We have this issue still on our app. Works fine on iOS until 2.2.0, but upgrading beyond 2.3.0 and this error arrives. We need to have a version which does not require hermes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests