我正在Ubuntu上运行Ionic。我已经安装了Android SDK,并且已经安装了可以使用它的工具。
[当我尝试运行ionic build android
时出现错误:
Running command: /home/fernando/Dropbox/Code/Kelps/KelpsApp/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/fernando/Dropbox/Code/Kelps/KelpsApp/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/fernando/Dropbox/Code/Kelps/KelpsApp/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:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
我试图在Google上查看此内容,但信息过多,对此没有解决方案。
有人已经收到此错误吗?
谢谢!
是,我之前遇到过此错误。但是作为您的日志,我们可以看到问题出在哪里:
错误:未设置ANDROID_HOME,并且PATH中未包含“ android”命令。您必须至少满足以下条件之一。
您已经安装了sdk
,但尚未将其设置为PATH
。
Control Panel
-> System
-> Advanced system settings
->选择Advance
选项卡Environment Variables...
User variables for ...
部分中,单击New
按钮。ANDROID_HOME
中键入Variable name
,然后在the path
中键入Variable Value
到sdk文件夹>OK
,OK
,OK
ionic
命令重试。在此职位上找到我的答案: