Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t将android平台添加到phonegap项目_Android_Cordova - Fatal编程技术网

Can';t将android平台添加到phonegap项目

Can';t将android平台添加到phonegap项目,android,cordova,Android,Cordova,我正在尝试将android平台添加到我的phonegap项目中。我已经添加了iOS平台,它工作起来没有任何问题。尝试通过命令添加android时 phonegap local run android 我总是遇到这样的错误: [error] The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools

我正在尝试将android平台添加到我的phonegap项目中。我已经添加了iOS平台,它工作起来没有任何问题。尝试通过命令添加android时

phonegap local run android
我总是遇到这样的错误:

[error] The command `android` failed. Make sure you have the latest Android SDK installed, and    the `android` command (inside the tools/ folder) added to your path.
我已经下载了最新的Android SDK,并设置了工具和平台工具文件夹的路径

export PATH=${PATH}:/Documents/android/sdk/platform-tools:/Documents/android/sdk/tools
我还使用

source ~/.bash_profile

事实证明,Android SDK的路径必须是绝对路径。在改变了我的道路之后

export PATH=${PATH}:/Users/your-username/Documents/android/sdk/platform-tools:/Users/your-username/Documents/android/sdk/tools 
我现在可以成功地将android平台添加到我的项目中