【问题标题】:PhoneGap/Cordova: Error: The command "android" failedPhoneGap/Cordova:错误:命令“android”失败
【发布时间】:2014-03-07 23:09:55
【问题描述】:

我是科尔多瓦的新手。 我按照this tutorial 创建了一个android 项目。但我在 MAC 上遇到以下错误:

错误:错误:“android”命令失败。确保您安装了最新的 Android SDK,并将“android”命令(位于 tools/ 文件夹内)添加到您的路径中。

我反复更新了 Android SDK 并编辑了 PATH ---

导出路径=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/abhisheksmacbook/adt-bundle/sdk/platform-tools:/abhisheksmacbook/adt-bundle/sdk /tools/安卓

错误仍然存​​在.. :( :( 有什么帮助吗?

Creating android project...
Error: An error occured during creation of android sub-project. 

/Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
                throw e;
                      ^
Error: The command "android" failed. Make sure you have the latest Android SDK installed,             and the "android" command (inside the tools/ folder) is added to your path.
at /Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:85:29
at _rejected (/Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
at /Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
at Promise.when (/Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
at /Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
at flush (/Users/abhisheksmacbook/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)

at /usr/local/lib/node_modules/cordova/src/platform.js:282:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

【问题讨论】:

  • 将此路径 abhisheksmacbook/adt-bundle/sdk/tools/android 更改为 abhisheksmacbook/adt-bundle/sdk/tools/ 并测试
  • @DiveshSalian :我先没有 android,然后我尝试使用 android.. 仍然存在错误。
  • 你在系统变量或用户变量中添加了路径???
  • @DiveshSalian:我刚刚在终端中点击了这一行:export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/abhisheksmacbook/adt- bundle/sdk/platform-tools:/abhisheksmacbook/adt-bundle/sdk/tools/

标签: cordova


【解决方案1】:

在 mac 上:编辑 ~/.bash_profile 中的 PATH 变量后,运行 source ~/.bash_profile 并关闭 所有 终端窗口。 再次打开终端,创建/构建android平台工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-18
    • 1970-01-01
    • 2016-07-25
    • 1970-01-01
    相关资源
    最近更新 更多