Hi Guys,
I’m working with OS X Yosemite and tried to add android platform in my project, but when i add android platform it’s return error
Running command: /Library/WebServer/Documents/xxxxx/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: /Library/WebServer/Documents/xxxxx/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:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Actualy, I’ve already set environment variable in ~/.bash_profile like this
well this seems to be a problem of the fact that the variable is set only for that particular terminal session, and not for the entire system… i am not an expert with OS X… so u need to figure out how to set the variable for entire system and not for a particular terminal session
Helpful hint for linux users who find themselves here. Make sure your editing the right .bash_profile, I kept getting the above error response until I realized I was editing the “/home/user/.bash_profile” instead of the “/root/.bash_profile”
I get the same error on ubuntu despite having ANDROID_HOME on my path. I have no idea what the problem is. The path is set in my .profile file.
Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:
Please update your Node runtime to version >=0.12.x
Running command: /home/johnboy14/ionic/myApp/hooks/after_prepare/010_add_platform_class.js /home/johnboy14/ionic/myApp
add to body class: platform-android
Running command: /home/johnboy14/ionic/myApp/platforms/android/cordova/build
[Error: Failed to find ‘ANDROID_HOME’ environment variable. Try setting setting it manually.
Failed to find ‘android’ command in your ‘PATH’. Try update your ‘PATH’ to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /home/johnboy14/ionic/myApp/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/johnboy14/ionic/myApp/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139: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)