When ever i install any dependency in my react native project and when ever i use link command for e.g react-native link react-native-gesture-handler this causes me an error shown in the image [1]. It doesn't build the project shows the error gradlew.bat
The following code shows my package.json file
{
"name": "navigations",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.3",
"react-native-gesture-handler": "^1.0.15",
"react-navigation": "^3.0.9"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.0.0",
"jest": "24.0.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
If you have WINDOWS machine, please follow these steps:
Optional (
Delete iOS, Android folders
Run `react-native eject` ( that command will rebuild deleted folders for you )
)
Then :
1) cd ./android
2) ./gradlew.bat installDebug
( with dot at the beggining )
Once it's successfully finished
3) cd ../
( go back to root folder )
4) react-native run-android
And fingers crossed for it to work as expected :) [for me it does]
cd ./android
create file file local.properties
then past this code sdk.dir=C\:\\Users\\muhammad ali\\AppData\\Local\\Android\\Sdk
change location to as per your sdk is located Done.
you already have local.properties file good.
find similar file of code sdk.dir=C\:\\Users\\muhammad ali\\AppData\\Local\\Android\\Sdk
change location to as per your sdk is located Done.
I had the same issue today... Wondering if you solved it?
go to android folder then settings.gradle file
You may find it on line 3
'..\node_modules\react-native-gesture-handler\android'
and replace all these backward slashes with forward like this
'../node_modules/react-native-gesture-handler/android'
Let me know if this helps...
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