2

i downloaded the sdk from android official website and installed the latest build tools using android sdk manager. I set android home as said here

but when i run cordova build android i got ANDROID_HOME is not your path.

Then i did as same as here but no luck.

Please help me to solve this.

Community
  • 1
  • 1
Saravanan
  • 337
  • 2
  • 6
  • 17

1 Answers1

5

Please verify that the SDK you downloaded really is located at the location you set. Do this by:

echo $PATH

and

echo $ANDROID_HOME

and verify that the last part of PATH and ANDROID_HOME is identical with where you unzipped the Downloaded zip.

If referring to here than you would have to replace "/opt/android/sdk" with the folder where you unzipped the SDK.

If using sudo you need to either call sudo with sudo -E flag or add the ANDROID_HOME to the Defaults env_keep in /etc/sudoers

Ben
  • 341
  • 4
  • 16
  • Hi Ben , this was my `echo $ANDROID_HOME /home/saravanan/software/android-sdk-linux ` android home and path was `echo $PATH /usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/saravanan/software/android-sdk-linux:/home/saravanan/software/android-sdk-linux/tools:/home/saravanan/software/android-sdk-linux/platform-tools ` but no luck – Saravanan May 30 '15 at 14:16
  • Are there any aliases that so that cordova get's startet as an other user? Or are you using sudo? You could try to directly give the path while starting cordova like `ANDROID_HOME=/home/saravanan/software/android-sdk-linux cordova build android` – Ben May 30 '15 at 23:11
  • Yes Ben , I am used sudo every time i tried to build a project. Your solution is working but is any other way to avoid giving ADNDROID_HOME at cordova build – Saravanan May 31 '15 at 03:01
  • I added it to the comment – Ben May 31 '15 at 08:23