Please help!! ANDROID_HOME is not set and "android"

1,499 views
Skip to first unread message

David Carlo

unread,
Mar 4, 2015, 12:07:29 PM3/4/15
to phon...@googlegroups.com
Hello All,

I am new to phonegap and would like to begin learning how to develop Android apps. My current OS is linux mint 17 64bit I have been following a tutorial on how to install phonegap for android app development you can see it here. https://miteshpatekar.wordpress.com/2014/11/12/install-and-create-cordova-android-application-on-linux-mint-17-ubuntu-14/. Everything works fine until I get to the point of running cordova build android then I am faced with the below error. I have searched an tried all the examples in stackoverflow most popular one is this one http://stackoverflow.com/questions/26356359/error-android-home-is-not-set-and-android-command-not-in-your-path-you-must-ful but there are still a lot of examples. All of the solutions seem to point to the path in my bashrc file which I have changed over and over again but its not working.

Here's the path I have set in bashrc please keep in mind I was following the tutorial and I originally had it setup that way but after researching stack overflow I saw post where people were setting the enviorment variable like the way I have posted it. 
export ANDROID_HOME=/home/selin/android-sdk-linux/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools

Here's the error I get: 
Running command: /home/selin/simpleapp/platforms/android/cordova/build 
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/selin/simpleapp/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/selin/simpleapp/platforms/android/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)

Kerri Shotts

unread,
Mar 4, 2015, 1:30:06 PM3/4/15
to phon...@googlegroups.com
At the prompt:

echo $ANDROID_HOME
echo $PATH

What do you get? I'm wondering if your script isn't being executed, and thus the paths aren't being exported. Make sure your .bashrc is being properly sourced.

I just put these in my profile. (~/.profile or ~/.bash_profile depending on your setup).

David Carlo

unread,
Mar 4, 2015, 2:34:36 PM3/4/15
to phon...@googlegroups.com
Hello Thank you for your response. I was trying this but did not see any issues this is why I am so confused.

echo $ANDROID_HOME 
/home/selin/adt-bundle-linux-x86_64-20140702/sdk

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/selin/adt-bundle-linux-x86-20140702/sdk/tools:/home/selin/adt-bundle-linux-x86-20140702/sdk/platform-tools:/home/selin/adt-bundle-linux-x86-20140702/sdk/tools/ant/bin:/home/selin/adt-bundle-linux-x86-20140702/sdk/tools:/home/selin/adt-bundle-linux-x86-20140702/sdk/platform-tools:/usr/share/ant/bin:/usr/lib/jvm/java-7-openjdk-amd64/bin

David

unread,
Mar 9, 2015, 9:28:04 AM3/9/15
to phon...@googlegroups.com
Based on my below response would you have any idea as to what is causing my issue. I have updated both profile and bashrc but cannot see to find any logical mistake I am making. How can I determine if my bashrc is properly sourced. 


On Wednesday, March 4, 2015 at 1:30:06 PM UTC-5, Kerri Shotts wrote:

Kerri Shotts

unread,
Mar 9, 2015, 3:29:45 PM3/9/15
to phon...@googlegroups.com
What output do you get if you execute this:

$ which android

?

David

unread,
Mar 9, 2015, 7:07:11 PM3/9/15
to phon...@googlegroups.com

When I run the command I am getting this bash: /home/selin/android-sdk-linux/sdk/tools/android: Permission denied. I have no clue why or what I am doing wrong.

Kerri Shotts

unread,
Mar 10, 2015, 1:48:25 AM3/10/15
to phon...@googlegroups.com
You have a permissions issue -- that is, your account doesn't have access to that path.

What does this give you?

ls -ltra /home/selin/android-sdk-linux/sdk/tools

If it gives you a permission denied error, keep going up the path tree until you don't get an error, like so:

ls -ltra /home/selin/android-sdk-linux/sdk
ls -ltra /home/selin/android-sdk-linux

etc.
Reply all
Reply to author
Forward
0 new messages