I just moved from Windows to Mac os. I tried running react-native using expo and I'm successful to do so, but when I run react native using cli, I get this error.
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...
FAILURE: Build failed with an exception.
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/danishiftikhar/Desktop/React Native/TestProject/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 9s
error 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.
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/danishiftikhar/Desktop/React Native/TestProject/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 9s
I tried running the emulator first and then react native and also tried running react-native without the emulator running. Both gave the same error.
I'm using Pixel XL API 29 as an emulator and my MacBook specs are as follows: Mac os Monterey 12.01 MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) 2.3 GHz Dual-Core Intel Core i5 8 GB 2133 MHz LPDDR3
Thanks in advance!