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
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 shot
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!!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With