Phonegap无法在Ubuntu上找到ANDROID_HOME环境变量

时间:2016-02-11 11:37:08

标签: cordova ubuntu environment-variables phonegap-cli

我跟着这个Tutorial在Ubuntu上安装了phonegap,一切正常,我甚至可以运行模拟器。

但是当我试图在其上运行我的phonegap项目时,我收到了这个错误:

1 2 3 4
5 6 7 8
9 10 11

正如文章所说,我在[phonegap] executing 'cordova emulate android'... cp: no such file or directory: /home/abdessalem/Documents/test/icon.png Running command: /home/abdessalem/Documents/test/platforms/android/cordova/run --emulator ERROR: 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: /home/abdessalem/Documents/test/platforms/android/cordova/run: Command failed with exit code 2

中添加了我的环境变量
~/.profile

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您可能需要

source ~/.profile

或退出,然后返回

或者您可以在尝试使用cordova命令之前输入导出命令

确保环境变量指向系统中的正确位置

相关问题