0

I have a problem while working on React-Native project. It is working for iOS. I've tried all the answers regarding this error but none of them is working.

Error Log :

Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong: Task 'installDebug' not found in project ':app'.

  • Try: Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

I'll provide you with the necessary information needed.

1 Answers1

0

Looks like your Java path is not set properly. Try adding this to your android/gradle.properties.

# Your java path here
org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_91

If this doesn't help try one of the solutions here.

Rohit Aggarwal
  • 1,048
  • 1
  • 14
  • 32
  • I've set the Java path to correct folder still not working!. I ran sudo ./gradlew assembleDebug in my android folder and is working. Still facing the same issue! I'm on a Mac Device. – Chetanjeev Singh Bains Jul 17 '21 at 16:35
  • @ChetanjeevSinghBains Please run `npx react-native doctor` it will give you the detail about development environment and missing dependencies – Rohit Aggarwal Aug 08 '21 at 03:33