nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

ubuntu ANDROID_HOME problem

Open sonersivri opened this issue 10 years ago • 5 comments

The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android. To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.

cd $ANDROID_HOME works fine

echo $cd $ANDROID_HOME /home/soner/android

tns --version 2.3.0

sonersivri avatar Oct 26 '16 19:10 sonersivri

@sonersivri As per the official documentation you need to set the path manually for JDK and the Android SDK. It's necessary for all Android Development, and is not the case with just the NativeScript CLI https://docs.nativescript.org/start/ns-setup-linux

petekanev avatar Oct 27 '16 04:10 petekanev

The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android. please can you help me with.... cant figure it out now

paqadvault avatar Oct 09 '17 13:10 paqadvault

@paqadvault Make sure you have all the required Android SDK packages installed too, these include SDK Platform 25, Android SDK Build-Tools 25.0.2 or later, Android Support Repository, Google Repository and any other SDKs that you may need.

sudo $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-25" "build-tools;25.0.2" "extras;android;m2repository" "extras;google;m2repository"

As per http://docs.nativescript.org/start/ns-setup-linux#advanced-setup-steps

petekanev avatar Oct 09 '17 13:10 petekanev

Was running into the same problem, nothing was working; after some tinkering the following worked for me:

Appended the following lines to /etc/bash.bashrc using sudo nano /etc/bash.bashrc then opened up a new terminal.

export ANDROID_HOME="/usr/local/android/sdk/"
PATH="${PATH}:${ANDROID_HOME}tools/:${ANDROID_HOME}platform-tools/"

Now it's working

luiscarbonell avatar Dec 13 '19 19:12 luiscarbonell

In my case it is cause by not having permission to .npm folder.

When run npm i, it said I have to run sudo chown -R 1000:1000 "/{path to my npm folder}/.npm

Works normal after I run that command.

I'm using tns --version 5.4.2

rickynugroho avatar Feb 02 '21 07:02 rickynugroho