2

after run sudo react-native run-android
echo error:

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

after add sdk.dir in local.properties is work, but i want fix generaly.

in ~/.bashrc

export ANDROID_HOME="$HOME/programs/android_sdk" export PATH="$PATH:$ANDROID_HOME/tools" export PATH="$PATH:$ANDROID_HOME/platform-tools"

but not work!
how can i fix it?

fihkoz
  • 21
  • 1
  • 2
    Possible duplicate of [SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID\_HOME environment variable](https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil) – VIISHRUT MAVANII Apr 11 '19 at 09:28
  • not possible and not solutions – fihkoz Apr 11 '19 at 10:02
  • Here, hope it support U ..... https://stackoverflow.com/a/48155800/8850042 – meowww Feb 21 '20 at 06:48

1 Answers1

0

Try adding like this

Add the following in ~/.bash_profile or ~/.bashrc.

export ANDROID_HOME=/usr/local/share/android-sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/23.0.1:$PATH

Worked for me this way.Hope it works for you too !