I am developing a react native app using yarn and whenever I try to run my app on an android device, I get the following error:
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 'mobile/android/local.properties'.
The weird thing is that I have installed the sdk (using brew install --cask android-sdk
) and set an export on my ./zshrc (using export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
) which gets correctly printed out to the screen if I type echo $ANDROID_SDK_ROOT
on my terminal.
To no avail, I have also tried a different approach I read about here, which was to create a file named local.properties
and set the variable there by doing something like sdk.dir = /usr/local/share/android-sdk
.
Any ideas why gradle cannot properly find the sdk?