[英]Cordova build fails at superspawn.js
When I do the cordova build android in cmd, it gives an error: 当我在cmd中使用cordova构建android时,它会出错:
the output is: 输出是:
D:\Projects\myprojectfortest-clone>cordova build android
Running command: D:\Projects\myprojectfortest-clone\platforms\android\cordova\build.b
at
Buildfile: D:\Projects\myprojectfortest-clone\platforms\android\build.xml
BUILD FAILED
D:\Projects\myprojectfortest-clone\platforms\android\build.xml:90: Cannot find D:\nb1
8908\Android22SDK\adt-bundle-windows-x86_64-20130917\sdk\tools\ant\build.xml imp
orted from D:\Projects\myprojectfortest-clone\platforms\android\build.xml
Total time: 0 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,D:\Projects\mysafari
com-clone\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant
-gen
Error: D:\Projects\myprojectfortest-clone\platforms\android\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (C:\Users\MyUser\AppData\Roaming\npm\node_modules\
cordova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
My Environment variables : 我的环境变量 :
ANDROID_HOME C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\tools
ANDROID_HOME
C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\tools
ANDROID_PLATFORM_TOOLS C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\platform-tools
ANDROID_PLATFORM_TOOLS
C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\platform-tools
ANDROID_PLATFORMS C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\platforms
ANDROID_PLATFORMS
C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\platforms
Path C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C:\\Program Files (x86)\\Intel\\Services\\IPT\\;C:\\Program Files\\WIDCOMM\\Bluetooth Software\\;C:\\Program Files\\WIDCOMM\\Bluetooth Software\\syswow64;C:\\Program Files (x86)\\Microsoft ASP.NET\\ASP.NET Web Pages\\v1.0\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\;C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\Best Practices Analyzer\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\nodejs\\;C:\\Program Files (x86)\\Java\\jdk1.7.0_55\\bin;%ANDROID_HOME%;%ANT_HOME%\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\TortoiseHg\\;C:\\Program Files\\Mercurial\\;C:\\apache-ant-1.9.3\\bin;%ANDROID_PLATFORM_TOOLS%;%ANDROID_PLATFORMS%;
路径
C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C:\\Program Files (x86)\\Intel\\Services\\IPT\\;C:\\Program Files\\WIDCOMM\\Bluetooth Software\\;C:\\Program Files\\WIDCOMM\\Bluetooth Software\\syswow64;C:\\Program Files (x86)\\Microsoft ASP.NET\\ASP.NET Web Pages\\v1.0\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\;C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\Best Practices Analyzer\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\nodejs\\;C:\\Program Files (x86)\\Java\\jdk1.7.0_55\\bin;%ANDROID_HOME%;%ANT_HOME%\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\TortoiseHg\\;C:\\Program Files\\Mercurial\\;C:\\apache-ant-1.9.3\\bin;%ANDROID_PLATFORM_TOOLS%;%ANDROID_PLATFORMS%;
C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C:\\Program Files (x86)\\Intel\\Services\\IPT\\;C:\\Program Files\\WIDCOMM\\Bluetooth Software\\;C:\\Program Files\\WIDCOMM\\Bluetooth Software\\syswow64;C:\\Program Files (x86)\\Microsoft ASP.NET\\ASP.NET Web Pages\\v1.0\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\;C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\Best Practices Analyzer\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\nodejs\\;C:\\Program Files (x86)\\Java\\jdk1.7.0_55\\bin;%ANDROID_HOME%;%ANT_HOME%\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\TortoiseHg\\;C:\\Program Files\\Mercurial\\;C:\\apache-ant-1.9.3\\bin;%ANDROID_PLATFORM_TOOLS%;%ANDROID_PLATFORMS%;
I have instaled the Android SDK version 2.2 and 4.4.2, what is wrong? 我已经安装了Android SDK版本2.2和4.4.2,有什么问题?
I knew this is kind of late but I hope it will help others. 我知道这有点晚了,但我希望它会帮助别人。 First I will like to correct some error I think I found in your path,
首先,我想纠正一些我认为在你的道路上发现的错误,
ANDROID_HOME C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk\\tools
ANDROID_HOME C:\\ Users \\ nb14696 \\ AppData \\ Local \\ Android \\ android-sdk \\ tools
it should read 它应该读
ANDROID_HOME C:\\Users\\nb14696\\AppData\\Local\\Android\\android-sdk
ANDROID_HOME C:\\ Users \\ nb14696 \\ AppData \\ Local \\ Android \\ android-sdk
Though you must have 虽然你必须拥有
%ANDROID_HOME%/tools and %ANDROID_HOME%/platform-tools
%ANDROID_HOME%/ tools和%ANDROID_HOME%/ platform-tools
must be available in your path. 必须在你的道路上可用。 Once you settle that excute
一旦你解决了这个问题
android list target
android列表目标
to confirm that you have your required targets. 确认您有所需的目标。 Then try your build command again
然后再次尝试构建命令
I had similar issue. 我有类似的问题。
The issue was with the incompatibility of the Ant version with my Java version. 问题在于Ant版本与我的Java版本不兼容。
Ant version I have is 1.8.4. 我的Ant版本是1.8.4。 Initially, I had JDK 8 - which supports only Ant 1.9 & greater
最初,我有JDK 8 - 它只支持Ant 1.9及更高版本
Therefore, I uninstalled JDK8 and reverted back to JDK7 因此,我卸载了JDK8并恢复了JDK7
Yes, I could have rather updated Ant itself. 是的,我本可以更新Ant本身。 That is also an option.
这也是一种选择。 However, I particularly needed Ant1.8
但是,我特别需要Ant1.8
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.