不能建立科尔多瓦项目 [英] Can't build cordova projects
问题描述
我有一个为Android建立了科尔多瓦的工作环境,在Windows 7的一个问题。我使用NetBeans 8和遵循该指南:的链接在这里
新项目 - >科尔多瓦 - > Hello World模板。
I have a problem with setting up the work environment for Cordova on Windows 7 for Android. I use NetBeans 8 and followed this guide: Link Here New project -> Cordova -> Hello World Template.
每当我尝试建立一个项目科尔多瓦(在NetBeans)我得到这个消息:
Whenever I try to build a Cordova project (in NetBeans) I get this message:
BUILD FAILED
C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml:90: Cannot find C:\Users\Administrator\SkyDrive\Skolegang\Dataingeniør\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml imported from C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml
Total time: 0 seconds
C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\cordova\node_modules\q\q.js:126
throw e;
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\cordova\run.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
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)
Command finished with error code 8: C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\cordova\run.bat --emulator
C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\nbproject\build.xml:272: exec returned: 1
BUILD FAILED (total time: 47 seconds)
我GOOGLE了它几个小时,但似乎无法找到一个解决方案。有些人得到一些相同的错误(不完全一样,但类似),但解决方案并没有为我工作。一个问题是关于Java的8和Ant版本1.9.0下(我用的节点0.10.26,JAVA 1.7.0_25,科尔多瓦3.5.0-0.2.4和蚂蚁1.9.4)。我也试图建立与控制台(CMD)的新项目,但是当我建立它给出确切的同样的错误。这是没有问题的创建项目,也将Android作为一个平台,问题是建设该项目。我觉得环境变量设置正确,因为在java,节点,蚂蚁和科尔多瓦命令工作,CMD / PowerShell的罚款,并在 check_reqs.bat
表示,环境很好。
I have googled it for hours but can't seem to find a solution. Some people get some of the same errors(not exact, but similar), but the solutions did not work for me. One issue was regarding Java 8 and ant versions beneath 1.9.0 (I use Node 0.10.26, java 1.7.0_25, cordova 3.5.0-0.2.4 and ant 1.9.4). I also tried to create a new project with the console (CMD), but it gives the exact same error when I build. It's no problem to create the project, nor adding Android as a platform, the problem is building the project. I think the environment variables are set correctly since the java, node, ant and cordova commands work fine in cmd/powershell, and the check_reqs.bat
said that the environment was fine.
这是该行创建错误:<导入文件=$ {} sdk.dir /tools/ant/build.xml/>
。这是消息的其余部分:找不到C:\\Users\\Administrator\\SkyDrive\\Skolegang\\Dataingeniør\\Android\\adt-bundle-windows-x86_64-20130729\\sdk\\tools\\ant\\build.xml进口C:\\Users\\Administrator\\Documents\\NetBeansProjects\\HTML5Application2\\platforms\\android\\build.xml.$c$c>
It's this line that creates the error: <import file="${sdk.dir}/tools/ant/build.xml" />
. This is the rest of the message: Cannot find C:\Users\Administrator\SkyDrive\Skolegang\Dataingeniør\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml imported from C:\Users\Administrator\Documents\NetBeansProjects\HTML5Application2\platforms\android\build.xml.
以下是错误我在命令窗口中(而不是使用NetBeans)获得:
Here is the error I get in the command window (not using NetBeans):
PS C:\\用户\\管理\\桌面\\测试\\ fakeApp>科尔多瓦构建Android
PS C:\Users\Administrator\Desktop\test\fakeApp> cordova build android
Running command: C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\cordova\build.bat
Buildfile: C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\build.xml
BUILD FAILED
C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\build.xml:90: Cannot find C:\Users\Administrator\SkyDrive\
Skolegang\Dataingeni├©r\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml imported from C:\Users\Admini
strator\Desktop\test\fakeApp\platforms\android\build.xml
Total time: 0 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,C:\Users\Administrator\Desktop\test\fakeApp\platforms\androi
d\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: C:\Users\Administrator\Desktop\test\fakeApp\platforms\android\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\s
rc\cordova\superspawn.js:131:23)
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)
我想也许这是一个路径问题,因为我已经在路径的特殊函中的NetBeansProjects存储(和它的pretty长也是如此),但创建位于C测试目录:\\和创建与项目命令窗口给了同样的错误。我事先是新在科尔多瓦,所以我敢肯定有一个简单的解决方案,谢谢。
I thought maybe it was a path issue since I have a special letter in the path were the NetBeansProjects are stored (and it's pretty long too), but creating a test directory at C:\ and creating the project with the command window gave the same error. I'm new at Cordova so I'm sure there's an easy solution, thanks in advance.
推荐答案
我解决了它,虽然我试图创建OneDrive文件夹,我没有想到的SDK路径(也存储在OneDrive)以外的科尔多瓦项目。由SDK文件移动到C:(路径很可能不包含特殊字母O)和不断变化的环境变量(和NetBeans SDK路径)的路径,现在运行的非常完美。
I solved it, though I tried to create a cordova project outside the OneDrive folder I did not think of the SDK path (which also were stored in OneDrive). By moving the SDK files to C: (the path could probably not contain the special letter 'ø') and changing the path of the environment variables (and the SDK path in NetBeans) it now runs perfectly.
这篇关于不能建立科尔多瓦项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!