error: command failed: gradlew.bat app:installdebug -preactnativedevserverport=8081

If you run into the following problem when running react-native run-android, please re-check your React Native environment setup.

error: command failed: gradlew.bat app:installdebug -preactnativedevserverport=8081

or

error: command failed: ./gradlew app:installdebug -preactnativedevserverport=8081

It’s likely that you got an old version of JDK or your ANDROID_HOME environment variable were set incorrectly.

The solution is making sure your environment variables like ANDROID_HOME and JDK version were set up / reinstalled correctly with respect to the official documentation of the framework https://reactnative.dev/docs/environment-setup.


More Articles

How to start a new Github repo from an existing project

Assume that you have a project and you want to track it with Github. Navigate to the project folder,...

codezilla

codezilla

How to check for listening ports in Linux

Here is one of the most popular commands for troubleshooting network or specific application problem...

codezilla

codezilla

How to get octal file permissions from command line?

Sometimes we want to know the octal number representing the permission of a file like 755, 777, 664 ...

codezilla

codezilla