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?
question from:
https://stackoverflow.com/questions/65853717/android-sdk-location-not-found-with-environment-variable-set 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…