Cordova平台添加android错误 [英] Cordova platform add android error

查看:42
本文介绍了Cordova平台添加android错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 ubuntu 12.04

Using ubuntu 12.04

cordova platform add android
Creating android project...

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occured during creation of android sub-project. 

/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at /home/admin/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:87:29
    at _rejected (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
    at /home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
    at Promise.when (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
    at /home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
    at flush (/home/admin/.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:244:30
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

我做错了什么?

推荐答案

简单的下载sdk,解压到某处,导出那个路径,做source生效,然后继续... :)

Simple as download sdk, extract somewhere, export that path, do source to take effect, then continue... :)

sudo gedit ~/.bashrc

添加PATH=$PATH:/opt/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/opt/adt-bundle-linux-x86_64-20140321/sdk/tools"到底部.

确保您指定的路径正确.adt-bundle-linux-x86_64-20140321根据您下载的版本而变化.

make sure your path specified is correct., adt-bundle-linux-x86_64-20140321 changes according to the version you download.

源代码 ~/.bashrc

进入当前会话的路径.

然后从你的构建目录(我的是 ~/phoneGapBuild/hello ).

then from your build directory (mine is ~/phoneGapBuild/hello ).

cordova 平台添加android

(@) 查看当前路径变量:

(@) To see current path variables:

回显 $PATH(如果没有看到新添加的变量,请退出终端重新打开)

echo $PATH (If you don't see newly added variables, please exit terminal and open it again)

(@) 如果你有类似的错误

(@) If you got an error like

错误:错误:正在执行命令ant",请确保您有 ant安装并添加到您的路径中.

Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.

运行以下注释来安装 ant.sudo apt-get -u install ant

run the following comment to install ant. sudo apt-get -u install ant

这篇关于Cordova平台添加android错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆