【发布时间】:2015-12-10 00:34:38
【问题描述】:
我正在尝试在 linux 中为 ionic 构建 android,但它向我显示了这样的错误
[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/kumar/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/kumar/myapp/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: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)
我已经在我的 bashrc 文件中添加了这个
export ANT_HOME="/usr/bin/ant"
export PATH="$PATH:$ANT_HOME/bin"
export HOME="/home/kumar"
export ANDROID_HOME="$HOME/android-sdk-linux/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/android-sdk-linux/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
我在想我已经给出了路径,但我不知道为什么它向我显示这个错误..请帮助....
【问题讨论】:
-
你使用的是ubuntu系统吗:?
-
请按照本教程link对您有帮助,我按照本教程仅用于安装Ionic框架
-
你检查过链接吗?
-
现在我正在检查它。谢谢..希望它有效..
-
嗯,欢迎,我会写这个答案,请接受并投票
标签: android linux cordova ionic-framework ionic