我在Windows 32位机器上安装了Apache Cordova 4.0,这一切都运行得很好。 我无法在另一台64位PC上做同样的事情(如果这有所不同)。 我已经检查了Path变量等,就像这个主题的其他问题一样,一切似乎都没问题。 当我尝试构建一个HelloWorld项目时,我得到以下构建输出:
\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 =========
我花了很多时间试图让它工作,包括多次安装,重新启动等,并将安装与有效的安装进行比较。 任何可能出错的指针都会很棒。这是我对这个非常有用的资源的第一个问题,如果我错过任何事情,请道歉。感谢。
Cordova版本:0.3.110914.1
答案 0 :(得分:2)
我终于解决了这个问题
尽管有正确版本的Java的正确路径,但Java jre和SDK的多个副本似乎导致了这个问题
变量:JAVA_HOME。值:C:\ Program Files \ Java \ jdk1.7.0_71
路径:...;%JAVA_HOME%\ bin; ...
这就是我所做的(尽管可能不需要以下所有步骤):