Skip to content Skip to sidebar Skip to footer

Android_home Is Not Set And "android" Command Not In Your Path Phonegap

i have installed android bundle and i have configured everything in .bashrc file and even when i say android in command line .. i am getting android manager .. but when i say ioni

Solution 1:

I faced the same problem, and it's solved.

I think it's issue with the compatibility of the latest cordova with latest android. As well as you've issue with the android home path.

In .bashrc file

export HOME="/home/indranil"export ANDROID_HOME="$HOME/software/adt-bundle-linux-x86_64-20140702/sdk"export PATH="$HOME/software/adt-bundle-linux-x86_64-20140702/sdk/tools:$ANDROID_HOME/platform_tools:$PATH"

Try to download the latest android SDK if you're using older version. And download Android 4.4.2(API 19) from your android manager.

You can use the latest cordova (4.0.0) but if the issue is still there then use cordova (3.5.0-0.2.7), but if you want to upgrade or downgrade the cordova, remove the existing one using:-

npm uninstall -g cordova(If linux use sudo npm uninstall -g cordova)

If you are using linux don't use sudo

commad at the time of installing cordoava, if you get any error, run the following commands

sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules
sudo chown -R `whoami` /usr/local

Then install cordova without sudo

npm install -g cordova@3.5.0-0.2.7

At the time of creating ionic app and adding android as platform don't use sudo command. Cordova creates a .cordova directory in the home folder at the time of adding platform. Remove that directory before creating the new ionic application.

And after downloading the android(4.4.2), create an android virtual device using the command:

android avd

Solution 2:

I have been struggling with this also (Ubuntu 14.04) and I remember accepting that just getting the cordova build command to work was too difficult for me :-). I was sure my PATHs were correct (tried root and user etc etc) and tried every solution I could find.

A comment by Stoicuta Alexandru On this page solved it for me. I quote:

If ANDROID_HOME is not set, cordova will search for it in home/android-sdk

So just putting my android sdk in the home-folder and (important) naming it android-sdk did it.

Hope to save some people some time...

Solution 3:

I had the same problem but I found an alternative method i.e. using the Phonegap Developer App. You could install it to the emulator and use it.

Solution 4:

In my case I first created the ionic app and ran other ionic commands using SUDO; that's why it was not working as sudo uses root profile.

This is how i fixed:

  1. delete the /home/user1/.cordova (replace user1 with you user name) i used "sudo rm" command to delete folder and all of its conents

  2. i deleted the /home/user1/tmp folder so that when we run the cordova again it creates the new tmp folder with proper permission of current user

  3. created new app using "ionic start app5" - this was the main issue as i previously was doing it with sudo

  4. added platform using "ionic platform add android"

  5. executed using "ionic run android"

remember that if from command line you can run "android" command and "java -version" command then above is perfect solution. let me know if you guys need any help from me.

Solution 5:

After facing for many day with this issue i follow the instructions above and set my .bash_profile like this on MAC

#====================================================export ANT_HOME=/usr/local/Cellar/ant/1.9.4/bin/ant
#export HOME="/Users/User"export ANDROID_HOME="$HOME/Downloads/Developer/adt-bundle-mac-x86_64-20140702/sdk"export PATH="$HOME/Downloads/Developer/adt-bundle-mac-x86_64-20140702/sdk/tools:$ANDROID_HOME/platform_tools:$PATH"#export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${PATH}#export PATH=${PATH}:/Users/User/Downloads/Developer/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/Users/User/Downloads/Developer/adt-bundle-mac-x86_64-20140702/sdk/tools:/Users/User/Downloads/Developer/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W
#
NPM_PACKAGES="${HOME}/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH"
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"## Unset manpath so we can inherit from /etc/manpath via the manpath# commandunset MANPATH # delete if you already modified MANPATH elsewhere in your config
MANPATH="$NPM_PACKAGES/share/man:$(manpath)"

Post a Comment for "Android_home Is Not Set And "android" Command Not In Your Path Phonegap"