android - 为 cordova 添加 android 平台时出错

标签 android node.js cordova

D:\Shabbir\AndroidTest>cordova platform add android
Creating android project...

C:\Documents and Settings\avaya11\Application Data\npm\node_modules\cordova\node
_modules\q\q.js:126
                    throw e;
                          ^
Error: An error occured during creation of android sub-project.

C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\node_mo
dules\q\q.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\
lib\check_reqs.js:87:29
    at _rejected (C:\Documents and Settings\avaya11\.cordova\lib\android\cordova
\3.3.0\bin\node_modules\q\q.js:808:24)
    at C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\
node_modules\q\q.js:834:30
    at Promise.when (C:\Documents and Settings\avaya11\.cordova\lib\android\cord
ova\3.3.0\bin\node_modules\q\q.js:1079:31)
    at Promise.promise.promiseDispatch (C:\Documents and Settings\avaya11\.cordo
va\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:752:41)
    at C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\
node_modules\q\q.js:574:44
    at flush (C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3
.0\bin\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:415:13)

    at C:\Documents and Settings\avaya11\Application Data\npm\node_modules\cordo
va\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:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)

D:\Shabbir\AndroidTest>

我得到这个错误

我下载了 NodeJS 并安装如下

npm -g install phonegap

npm -g install cordova

npm -g install plugman

npm -g install ant

我为此设置了一些路径

PATH
C:\Documents and Settings\avaya11\Application Data\npm;C:\Documents and Settings\avaya11\Application Data\npm\node_modules\ant;C:\NEW ANDROID\sdk\platforms;C:\NEW ANDROID\sdk\platform-tools;C:\Documents and Settings\avaya11\Application Data\npm\node_modules\ant\bin;C:\Program Files\Java\jdk1.6.0_45\bin

这是我从 here 下载的 ANT_HOME 路径

ANT_HOME
C:\Program Files\Java\apache-ant-1.9.3

还添加了 JAVA_HOME , ANDROID_HOME

我做了所有可能的方法,但仍然发现错误 PLZ 帮助我找到解决方案 我想我对设置路径感到困惑。

最佳答案

经过大量的研究工作,我找到了答案。

我还没有设置 xcopy 的路径。

xcopy.exe - 此文件包含 sdk 平台信息。 所以我添加了它的路径。 xcopy.exe 位于 system32 文件夹中。

所以我添加了这样的路径,并且我能够添加 android 平台。

%SystemRoot%\System32;

关于android - 为 cordova 添加 android 平台时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21431363/

相关文章:

node.js - 使用 OAuth 时的 Google 日历 "The request is missing a valid API key"

android - 我应该在我的 android native 应用程序中使用 CordovaWebView 还是 AndroidWebView?

android - 如何对齐 ActionBar 中的菜单项

javascript - 比较两个不同的数组元素删除node js中的匹配元素

android - 我可以启动几个帧并循环帧的其余部分,而无需以编程方式调用 setProgress() 吗?

JavaScript - 自调用匿名函数是否充分保护变量免受全局命名空间的影响?

javascript - 是什么导致 TypeError : Expected `input` to be a `Function` or `Object` issue with gtoken and pify?

android - 自动在 Play Store 或 App Store 中搜索应用程序

安卓进度条 : how to set secondary color programmatically

android - python - 数据库提取缺少 ids (u'1') 并且有额外的 ids (1),可能是由于先前请求中的类型不一致造成的