0

I have search and applied all solutions I found on stack overflow. This is what I did
export

ANDROID_HOME=/home/shamsher/android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Still I got this error

/home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
    at /home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:159:19
    at _fulfilled (/home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:760:13)
    at /home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:821:14
    at flush (/home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:902:3
Error: /home/shamsher/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135: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)
iagreen
  • 31,470
  • 8
  • 76
  • 90
Shamsher
  • 1,761
  • 4
  • 21
  • 30
  • I have also set these from command line export ANDROID_HOME=/home/shamsher/android/sdk export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools – Shamsher Nov 24 '14 at 06:24

1 Answers1

0

You need to add your path to your profile I think, or else it will only be available during the terminal session that you've used to create it.

How to permanently set $PATH on Linux?

You can also add it to ~/.bashrc file and then just issue

source ~/.bashrc
Community
  • 1
  • 1
Avram Tudor
  • 1,468
  • 12
  • 18
  • I have added path in ~/.bashrc and ~/.profile. But still it doesn't work. this is my path export ANDROID_HOME=/home/shamsher/android/sdk export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools – Shamsher Dec 01 '14 at 09:10