Error : interpolate() was renamed to interpolateNode() in Reanimated 2. Please use interpolateNode() instead - react-native

I have a Small problem getting this to work without warnings or Errors
I stumbled into this Error trying to get this to work, following a step by step tutorial on here from this tutorial https://medium.com/#ritikjain1272/making-drawer-navigator-and-a-splash-screen-on-your-react-native-app-2fb561ee17f1
Now I have installed everything correctly, then it gives me this warning interpolate() was renamed to interpolateNode() in Reanimated 2. Please use interpolateNode() instead
How Can I resolve this , Downgrading gives a further Error.
This is what the Package.json Looks like
{
"name": "**********",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "17.0.1",
"react-native": "0.64.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.1.1",
"react-native-vector-icons": "^8.1.0",
"react-navigation": "^4.4.4",
"react-navigation-drawer": "^2.7.0",
"react-navigation-stack": "^2.10.4"
},
"devDependencies": {
"#babel/core": "7.13.15",
"#babel/runtime": "7.13.10",
"#react-native-community/eslint-config": "2.0.0",
"babel-jest": "26.6.3",
"eslint": "7.14.0",
"jest": "26.6.3",
"metro-react-native-babel-preset": "0.64.0",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}
Edit
The image after downgrading I get

You have installed the latest stable react-native-reanimated version, whilst in the tutorial the version 1.7.0 is being used.
So you'll have to change your react-native-reanimated version to 1.7.0. Change the version in your package.json file:
"dependencies": {
...
"react-native-reanimated": "^1.7.0",
...
}
And then run npm install and npx pod-install/cd ios && pod install if you're running it on iOS.

Related

Unable to resolve module #react-navigation/material-top-tabs?

I tried many commands to solve this issue, but i couldnt find the answer, nothing worked. Last, i used
npm install react-navigation-tabs
react-native start --reset-cache
but they didnt work, i still get the same error.
I installed it as
npm install #react-navigation/material-top-tabs react-native-tab-view#^2.16.0
and imported this import { createMaterialTopTabNavigator } from '#react-navigation/material-top-tabs'; but still no, it doesn't work.
this is my package.json as i thought there may be a problem with;
{
"name": "smarthome",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-navigation/material-bottom-tabs": "^5.3.15",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.4",
"native-base": "^2.15.2",
"react": "17.0.1",
"react-native": "0.64.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-paper": "^4.8.1",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.1.1",
"react-native-vector-icons": "^8.1.0",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4",
"react-navigation-tabs": "^2.11.1"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}
npm uninstall react-native-cli
npx rm -rf node_modules
npm install -i -g --force react-native-cli
those codes solved my problem.

React-Native navigation unable to resolve module

I am getting an error that #react-navigation/native could not be found within the project. I tried to install it and my package.json file says. I am not sure what to do next to get it running. Cheers {
"name": "sample",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/native": "^5.5.1",
"#react-navigation/stack": "^5.5.1",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.0.4",
"react-native-screens": "^2.8.0"
},
"devDependencies": {
"#babel/core": "^7.10.2",
"#babel/runtime": "^7.10.2",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.0.1",
"eslint": "^7.2.0",
"jest": "^26.0.1",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.11.0"
},
"jest": {
"preset": "react-native"
}
}
I get that problem sometimes as well, when I restart the app the problem is gone. I don't know why it happens, though.

'#react-navigation/stack' has stopped working with error - unable to resolve module

I have been successfully using React Navigation Stack (V5) for about a week now and today my app will not build as the error - unable to resolve module is now shown.
Error Message
The module is installed as shown in my package.json file -
{
"scripts": {
"postinstall": "jetify",
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"#react-native-community/masked-view": "^0.1.6",
"expo": "~36.0.0",
"expo-linear-gradient": "^8.0.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "~0.61.4",
"react-native-fontawesome": "^7.0.0",
"react-native-gesture-handler": "^1.5.6",
"react-native-keyboard-aware-scroll-view": "^0.9.1",
"react-native-reanimated": "^1.7.0",
"react-native-safe-area-context": "^0.7.2",
"react-native-screens": "^2.0.0-beta.2",
"react-native-unimodules": "~0.7.0",
"react-native-web": "~0.11.7",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3"
},
"devDependencies": {
"#babel/core": "~7.6.0",
"babel-jest": "~24.9.0",
"jest": "~24.9.0",
"jetifier": "~1.6.4",
"metro-react-native-babel-preset": "~0.56.0",
"react-test-renderer": "~16.9.0"
},
"jest": {
"preset": "react-native"
},
"private": true
}
I have tried the following steps to try resolve the issue -
Deleted node_modules
Cleared yarn and npm cache
Ran npm install to install dependencies again
Cleared expo cache
Deleted and re-downoaded expo app on iOS device
Also tried installing the react navigation stack package again
Still receiving the same error message.
Would MASSIVELY appreciate any ideas.. currently losing my head over this :|
You don't have #react-navigation/stack or any #react-navigation/xxx packages in your package.json. You have react-navigation-xxx packages which are for v4.
Follow the getting started guide to set it up properly https://reactnavigation.org/docs/en/getting-started.html
Try to delete the package-lock file and run npm i

unable to reduce react-native application's size

i made an app with expo but am not satisfied with it's size, i found this blog/tutoriel on how to reduce it using react-native init project , here is the link : https://medium.com/#aswinmohanme/how-i-reduced-the-size-of-my-react-native-app-by-86-27be72bba640
the blog says to "Install all dependencies of the Expo project except Expo specific libraries." , but since i made the app with expo i used expo-av and expo-linear-gradient,it gave me this error
error: bundling failed: Error: Unable to resolve module #unimodules/core from
node_modules/expo-av/build/ExponentAV.js`: #unimodules/core could not be found within the project.
this error was fixed after i downloaded expo into the directory, it gave me a white screen but the build was succesfull.
when i removed the expo related libaries, it gave an error (ofcourse..).
NOTE : this isn't the first time that android studio emulator gives the white screen :( , so what am i doing wrong !!
here is the current package.json , i didn't change anything else in the project directory exept from adding the js files and the assets folder.
{
"name": "fixemulatorBug",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"expo-av": "5.0.2",
"expo-linear-gradient": "~5.0.1",
"react": "16.9.0",
"react-dom": "16.8.3",
"react-native": "0.61.3",
"react-native-drawer": "2.2.2",
"react-native-elements": "1.2.1",
"react-native-gesture-handler": "^1.5.0",
"react-native-reanimated": "^1.4.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "0.11.7",
"react-navigation": "4.0.10",
"react-navigation-drawer": "2.2.2",
"react-navigation-stack": "^1.9.4"
},
"devDependencies": {
"#babel/core": "^7.6.4",
"#babel/runtime": "^7.6.3",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.6.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.57.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}

React native version mismatch after upgrading to 0.61.1 in brand new project

I am upgrading my React Native app from 0.59 to 0,61. What I did was to generate a brand new project from ground up with react-native init emps_fe6 and yarn add each module in package.json. Also copy the components and App.js over to the new project. Here is my new package.json file:
{
"name": "emps_fe6",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/async-storage": "^1.6.2",
"moment": "^2.24.0",
"react": "16.9.0",
"react-native": "0.61.1",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-field": "^3.9.0",
"react-native-device-info": "^3.1.4",
"react-native-elements": "^1.2.3",
"react-native-gesture-handler": "^1.4.1",
"react-native-gifted-chat": "^0.10.1",
"react-native-keychain": "^4.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal": "^11.4.0",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^4.0.10",
"socket.io-client": "2.1.1"
},
"devDependencies": {
"#babel/core": "^7.6.2",
"#babel/runtime": "^7.6.2",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
Then start on Android emulator with react-native run-android. It throws out the error of version mismatch:
I don't quite understand what causes the error, as there is no reference to version 0.59.9 in components and App.js copied. The project is started from brand new and each module is yarn add individually. Only thing from previous version is the components and App.js.
Maybe you had metro bundler running with a previous version of React Native which caused this issue. So, what I typically do when I face this problem is to start the bundler like npm start --reset-cache. Make sure to stop any metro bundler running.
If problem persist try restarting your machine.