react-native android app compile problems

21 views Asked by At

It is my first time using react-native. I followed this youtube video. But when I try to run my app using npx react-native run-android I get the following error:

info A dev server is already running for this project on port 8081.
'"adb"' is not recognized as an internal or external command,
operable program or batch file.

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...

This error is followed by another one after the app installed:

error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Could not determine the dependencies of null. > SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\runnl\Desktop\app\newapp\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 3s.

I already searched StackOverflow for existing answers but none seem to deal with my problem in particular, these are the resources I have found:

1

There are 1 answers

0
İlker On

It is best to follow the steps in the original document. You can access the actual document at this link. "https://reactnative.dev/docs/environment-setup"