Waleed Naveed
Waleed Naveed

Reputation: 2381

'gradlew.bat' is not recognized as an internal or external command, react native

I am new to react-native / android development. I have created a react-native project. I have to run it on a real physical android device. I am following the react-native official documentation. When i do react-native run-android, i get the following error.

debug Running command "cd android && gradlew.bat app:installDebug -PreactNativeDevServerPort=8081"
'gradlew.bat' is not recognized as an internal or external command,operable program or batch file.

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: spawn gradlew.bat ENOENT

I did check adb device, my device is attached with the system but i am unable to install/run the app on real android device.

Can anyone help me ? I am stuck on this issue for 2 days.

Upvotes: 3

Views: 998

Answers (1)

Anus Kaleem
Anus Kaleem

Reputation: 564

  1. Download latest gradle distribution.
  2. Set path variables
  3. From your cmd and inside android directory, run following command

    gradle wrapper

This will create necessary gradlew file inside your android directory. After this try running your app on actual device again.

Upvotes: 2

Related Questions