Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

my react-native project was running, but today i tired to run it on andorid it gived the the abouve Error TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions'). tried alot of thing gradlew clean node modules deleted cache-clear but no thing works

like image 512
Engr.Aftab Ufaq Avatar asked Oct 28 '25 19:10

Engr.Aftab Ufaq


2 Answers

Hello Here is the solution. go to android/app/build.gradle and search for the line

project.ext.react = [
    enableHermes: false,  // clean and rebuild if changing
]

change this to

project.ext.react = [
    enableHermes: true,  // clean and rebuild if changing
]

and in MainApplication.java file add these two line to the top

import com.facebook.react.bridge.JSIModulePackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;

and add this function

@Override
protected JSIModulePackage getJSIModulePackage() { 
      return new ReanimatedJSIModulePackage(); 
    }

Here is the screen shotenter image description here

in the bable.config.js file add these ,lines like this

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    "react-native-reanimated/plugin",
  ],
};

and index.js

import 'react-native-gesture-handler'

After this clean your project, uninstall from the device and build it again. Cheers!!

like image 168
Engr.Aftab Ufaq Avatar answered Oct 31 '25 13:10

Engr.Aftab Ufaq


Step 1:- go to android/app/build.gradle

project.ext.react = [enableHermes: false,] // update here true

Step 2:- go to android/app/src/main/java[Your Packages]/MainApplication.java

    import com.facebook.react.bridge.JSIModulePackage;
    import com.swmansion.reanimated.ReanimatedJSIModulePackage;
    
private final ReactNativeHost mReactNativeHost =
      new ReactNativeHost(this) {
...
    @Override
    protected JSIModulePackage getJSIModulePackage() { 
          return new ReanimatedJSIModulePackage(); 
        }
};

Step 3:- go to bable.config.js

module.exports = {
  ...
  plugins: ["react-native-reanimated/plugin"],   //add this line
};

Step 4:- go to index.js

import 'react-native-gesture-handler'

Step 5:- paste this command on Terminal

npx react-native start --reset-cache

Step 6:- clean gradlew , delete build file under android/app and uninstall app from the devices

Step 7:- run your project

like image 23
Gyan Prakash Avatar answered Oct 31 '25 13:10

Gyan Prakash