Setup local environment in Ubuntu 18.04



I am trying to setup local environment in Ubuntu 18.04. getting error in android setup. here screenshot of terminal

and if run $ANDROID_HOME/tools/bin/sdkmanager --list command, get these, i installed all

i am new in nativescript, so please him me to solve this problem



there is sdkmanager --list command


what do have in PATH environment variable?


export ANDROID_HOME=$HOME/android/sdk


what does it show when you run “echo $PATH”?




I think you need to add sdk/tools and sdk/platform-tools to the PATH

run this command

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


sorry bro, not working, screenshot from .bashrc file


What is the latest output of “tns doctor” and output of “echo $PATH”?



and tns doctor output same, same error, not found sdk


solved the problem, wasn’t problem with PATH, it was android version and build-tools version, i had to install android version 25 and build-tolls 27.0.3
$ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-25" "build-tools;27.0.3" "extras;android;m2repository" "extras;google;m2repository"

btw, thanks, @vamsi


Cool, didn’t realise you had build-tools version 28


The whole process was

# first install 
sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 libstdc++6:i386

# install java8
sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

# export environment
sudo nano .bashrc

# then paste at last
export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')

# make dir 
mkdir android/sdk

# then download android sdk command line tools only
# extract and copy tools in android/sdk folder

# export environment
sudo nano .bashrc

# then paste at last
export ANDROID_HOME=$HOME/android/sdk

# then file
touch ~/.android/repositories.cfg

# then hit this command and keep typing y and press ENTER
$ANDROID_HOME/tools/bin/sdkmanager --licenses

# then install android sdk
$ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-25" "build-tools;27.0.3" "extras;android;m2repository" "extras;google;m2repository"

# then install emulator
$ANDROID_HOME/tools/bin/sdkmanager "system-images;android-25;google_apis;x86"

# then create emulator
$ANDROID_HOME/tools/bin/avdmanager create avd -n android-25 -k "system-images;android-25;google_apis;x86"

# open emulator
sudo $ANDROID_HOME/tools/emulator @android-25