简体   繁体   English

无法在64位Windows-7的Cordova -VS 2013社区中使用Android Build

[英]Cannot get Android Build to work in Cordova -VS 2013 Community on 64bit Windows-7

I installed Apache Cordova 4.0 on a Windows 32 bit machine and it all worked perfectly. 我在Windows 32位计算机上安装了Apache Cordova 4.0,并且一切正常。 I cannot get it do do the same on another PC which is 64 bit (if that makes a difference). 我无法在另一台64位PC上做同样的事情(如果有所不同)。 I've checked the Path variables etc as in other questions on this topic and all seems ok. 我已经检查过Path变量等,如关于此主题的其他问题一样,一切似乎还不错。 I get the following Build Output when I try to build a HelloWorld project: 当我尝试构建HelloWorld项目时,我得到以下Build Output:

\Debug
1>  Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "C:\Users\Billy

\documents\visual studio 2013\Projects\BlankCordovaApp7\BlankCordovaApp7\bld\Debug"
1>  Using stock cordova hello-world application.
1>  cordova library for "www" already exists. No need to download. Continuing.
1>  Copying stock Cordova www assets into "C:\Users\Billy\documents\visual studio 2013\Projects

\BlankCordovaApp7\BlankCordovaApp7\bld\Debug\www"
1>  ------ Adding platform: android
1>  Creating android project...
1>  Running command: C:\Users\Billy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\create.bat --cli "C:\Users

\Billy\documents\visual studio 2013\Projects\BlankCordovaApp7\BlankCordovaApp7\bld\Debug\platforms\android" 

io.cordova.BlankCordovaApp7 BlankCordovaApp7
1>  
1>  C:\Users\Billy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>MDAVSCLI : error : Failed to run "android". Make sure you have the latest Android SDK installed, and that the "android" 

command (inside the tools/ folder) is added to your PATH.
1>      at C:\Users\Billy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\lib\check_reqs.js:43:27
1>      at exithandler (child_process.js:644:7)
1>      at ChildProcess.errorhandler (child_process.js:660:5)
1>      at ChildProcess.emit (events.js:95:17)
1>      at Process.ChildProcess._handle.onexit (child_process.js:808:12)
1>  Command finished with error code 8: C:\Users\Billy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\create.bat 

--cli,C:\Users\Billy\documents\visual studio 2013\Projects\BlankCordovaApp7\BlankCordovaApp7\bld\Debug\platforms

\android,io.cordova.BlankCordovaApp7,BlankCordovaApp7
1>MDAVSCLI : error : C:\Users\Billy\.cordova\lib\npm_cache\cordova-android\3.6.4\package\bin\create.bat: Command failed 

with exit code 8
1>Done executing task "MdaVsCli" -- FAILED.
1>Done building target "PrepareForRippleRequirements" in project "BlankCordovaApp7.jsproj" -- FAILED.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.97
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

I've spent many hours trying to get this to work including multiple installs, re-boots etc and comparing the install with the one that works. 我花了很多时间试图使它生效,包括多次安装,重新引导等,并将安装与可行的安装进行比较。 Any pointers to what may be amiss would be great. 任何可能出现问题的指针都是很棒的。 This is my first question on this incredibly useful resource so apologies if I've missed anything. 这是我关于这个非常有用的资源的第一个问题,如果错过了任何内容,我们深表歉意。 Thanks. 谢谢。

Cordova is version: 0.3.110914.1 科尔多瓦版本:0.3.110914.1

I've finally fixed this. 我终于解决了这个问题。
Despite having correct path to the correct version of Java, multiple copies of Java jre and SDK seemed to be causing the problem. 尽管有通往正确版本的Java的正确路径,但Java jre和SDK的多个副本似乎是造成此问题的原因。
Variable: JAVA_HOME. 变量:JAVA_HOME。 Value: C:\\Program Files\\Java\\jdk1.7.0_71 值:C:\\ Program Files \\ Java \\ jdk1.7.0_71
Path: ...;%JAVA_HOME%\\bin;... 路径:...;%JAVA_HOME%\\ bin; ...
This is what I did (although all steps below may not be required): 这就是我所做的(尽管可能不需要以下所有步骤):

  1. Edit registry with regedit to point to correct versions (1.7) for JDK and JRE. 使用regedit编辑注册表,以指向JDK和JRE的正确版本(1.7)。 (HKEY_LOCAL_MACHINE\\SOFTWARE\\JAVASOFT...) (HKEY_LOCAL_MACHINE \\ SOFTWARE \\ JavaSoft的...)
  2. Ensure jre7 and JDK1.7.0_71 were in the same folder. 确保jre7和JDK1.7.0_71位于同一文件夹中。 In my case C:\\Program Files\\Java\\jdk1.7.0_71 and C:\\Program Files\\Java\\jre7. 在我的情况下,C:\\ Program Files \\ Java \\ jdk1.7.0_71和C:\\ Program Files \\ Java \\ jre7。
  3. In Control Panel uninstall all versions of Java jre and SDK except the two listed above in that location. 在控制面板中,卸载该位置上上面列出的两个版本的Java jre和SDK的所有版本。 (I had multiple copies of 1.7 and 1.8 in various places). (我在不同地方有1.7和1.8的多个副本)。
  4. Re-boot. 重启。

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

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