0

I already installed Android Studio and all the required tools and SDK version based on the documentation of react-native, I also followed all the instructions on the documentation. however , I dont understand this error, I'm new to react-native.

enter image description here

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 967 file(s) to forward-jetify. Using 4 workers... info JS server already running. /bin/sh: adb: command not found info Launching emulator... error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app...

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine the dependencies of task ':app:installDebug'.

SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/rochesterpeduche/Desktop/AwesomeTSProject/android/local.properties'.

  • Try: 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

BUILD FAILED in 2s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

Karan Mehta
  • 1,442
  • 13
  • 32
  • As the error says, it did not find Android SDK. Please refer to this answer https://stackoverflow.com/questions/32634352/react-native-android-build-failed-sdk-location-not-found which should solve your problem. – Sameer Kumar Jain Sep 03 '20 at 08:49
  • You should also upvote the answer if you found it to be helpful so that it can help others as well. – Karan Mehta Sep 07 '20 at 04:17

1 Answers1

0

You need to set environment variable for android sdk like this :

Go to File explorer and right click

enter image description here

Then go to properties and select Advance system settings

enter image description here

Then select Environment Variables

enter image description here

Then select User Variables and path variable inside that

enter image description here

Then add path to your android SDK as shown in above image and click save and check!!!!

Karan Mehta
  • 1,442
  • 13
  • 32