这是我在cordova的第一次经历。我创建了helloworld项目并正确安装了android平台。当我尝试按cordova build android
构建项目时,它会显示此错误消息。
Running command: /home/menaka/hello/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/menaka/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/menaka/hello/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)
但我已成功设置ANDROID_HOME
变量和PATH
。
menaka@menaka-X550LC:~/hello$ echo $ANDROID_HOME
/Extra/Softwares/Android/Sdk/
那么,这是什么原因?