简体   繁体   English

phonegap:创建android子项目时发生错误

[英]phonegap: An error occured during creation of android sub-project

I am trying to setup the environment to create phonegap applications. 我正在尝试设置环境以创建phonegap应用程序。 I've been trying to set up everything for a long time, but I don´t achieve it... All the Environment Variables are correct: JAVA_HOME, ANT_HOME, PATH.. And I deleted .cordoba from my User Folder, but I still get this error. 我一直在尝试设置所有内容,但是我没有实现……所有环境变量都是正确的:JAVA_HOME,ANT_HOME,PATH ..并且我从用户文件夹中删除了.cordoba,但是我仍然会收到此错误。

Can you Help me? 你能帮助我吗? I would really appreciate it! 我真的很感激!

Thanks! 谢谢!

C:\Users\Javier\pruebaiamvo>phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[phonegap] missing library cordova/android/3.3.0
[phonegap] downloading https://git-wip-us.apache.org/repos/asf?p=cordova-android
.git;a=snapshot;h=3.3.0;sf=tgz...
   [error] An error occured during creation of android sub-project.

C:\Users\Javier\.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 C:\Users\Javier\.cordova\lib\android\cordova\3.3.0\bin\lib\check_reqs.js:
87:29
at _rejected (C:\Users\Javier\.cordova\lib\android\cordova\3.3.0\bin\node_mo
dules\q\q.js:808:24)
at C:\Users\Javier\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.j
s:834:30
at Promise.when (C:\Users\Javier\.cordova\lib\android\cordova\3.3.0\bin\node
_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\Javier\.cordova\lib\android\cor
dova\3.3.0\bin\node_modules\q\q.js:752:41)
at C:\Users\Javier\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.j
s:574:44
at flush (C:\Users\Javier\.cordova\lib\android\cordova\3.3.0\bin\node_module
s\q\q.js:108:17)
at process._tickCallback (node.js:415:13)

You need to define XCOPY on your path as it is used by the internal node.js scripts to move things around. 您需要在路径上定义XCOPY,因为内部node.js脚本会使用它来移动内容。

You have xcopy.exe somewhere on your machine. 您的计算机上的某个地方有xcopy.exe。 You should be able to add %SystemRoot%\\System32 to your PATH. 您应该能够将%SystemRoot%\\ System32添加到PATH。

Or you can open up a terminal and type 'where xcopy' to see the actual path to your xcopy.exe. 或者,您可以打开终端并键入“ where xcopy”,以查看xcopy.exe的实际路径。

I guess having XCOPY on the path is a requirement for setting up and installing Android, but it'd be nice if Cordova checked to make sure you have XCOPY somewhere... 我猜想在路径上安装XCOPY是安装和安装Android的必要条件,但是如果Cordova检查并确保您在某处安装XCOPY,那就太好了……

This is also explained on post below- 下面的帖子也对此进行了解释-

An error occured during creation of android sub-project 创建android子项目时发生错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM