【发布时间】:2015-05-21 17:31:58
【问题描述】:
这是我的安卓主页和路径
manish@manish-Vostro-2520:~/hello$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.7.0/bin:/home/manish/Android/Sdk/tools:/home/manish/Android/Sdk/platform-tools
manish@manish-Vostro-2520:~/hello$ $ANDROID_HOME
bash: /home/manish/Android/Sdk: Is a directory
但当我执行sudo 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/manish/hello/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/manish/hello/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: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)
这里是 ~/.bashrc 条目
#android path
export ANDROID_HOME=~/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
【问题讨论】: