I am trying to run
react-native run-android inside of a CentOS desktop. I get the following error:
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
So first I go to the root of the react native project and then to the
android/ folder. In there I create a file called
local.properties and add:
sdk.dir = /home/daniel.cortes/Android/sdk.
react-native run-android again and get the same error. So I tried the second option which was to go to
vim ~/.bashrc and add
export ANDROID_SDK_ROOT=$HOME/daniel.cortes/Android/sdk, which I did. Then I ran
source ~/.bashrc and then ran
react-native run-android and I am still getting the same error. What gives here?
Try opening the
android/ folder with android studio and let it auto sync. It should generate a
local.properties file to resolve this issue.