问题描述
这个问题看起来很熟悉
Error: ANDROID_HOME未设置和android命令不在您的路径,都必须满足这些条件至少有一个
The issue looks very familiar with thisError: ANDROID_HOME is not set and android command not in your path You must fulfill at least one of these conditions
但我不能修复它。当我运行
But I am not able to fix it. When I run
% sudo cordova build android
我收到以下错误
Running command: /home/thabung/mobile/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/thabung/mobile/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/thabung/mobile/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.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
几件事情我观察
% echo $ANDROID_HOME
返回我
~/mobile/android-sdk-linux
这是完美的位置
&安培; Android的命令也能正常工作。
请帮忙..
我使用的科尔多瓦4.3.0
which is perfect location& android command also works fine.Please help..I am using cordova 4.3.0
推荐答案
这...
sudo cordova build android
在运行的环境中的根的,而这个...
echo $ANDROID_HOME
不作为的根的执行。检查什么回声$ ANDROID_HOME
申报表的根的 - 或(强烈推荐) - 运行科尔多瓦作为另一个用户比的根的。
was not executed as root. Check what echo $ANDROID_HOME
returns as root - or (strongly recommended) - run Cordova as another user than root.
P.S 的:我运行科尔多瓦在Ubuntu 14.04 4.0.0无须藤
这篇关于科尔多瓦构建Android抛出错误在Ubuntu 12.04的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!