gpt4 book ai didi

android - Cordova 构建在 superspawn.js 失败

转载 作者:可可西里 更新时间:2023-11-01 11:29:44 25 4
gpt4 key购买 nike

当我在 cmd 中执行 cordova build android 时,出现错误:

输出是:

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)

我的环境变量:

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_PLATFORMS C:\Users\nb14696\AppData\Local\Android\android-sdk\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\服务\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 平台安装程序\;C:\Pro gram Files\TortoiseHg\;C:\Program Files\Mercurial\;C:\apache-ant-1.9.3\bin;%ANDROID_PLATFORM_TOOLS%;%ANDROID_PLATFORMS%;

我已经安装了 Android SDK 版本 2.2 和 4.4.2,有什么问题吗?

最佳答案

我知道这有点晚了,但我希望它能帮助其他人。首先,我想纠正一些我认为在您的路径中发现的错误,

ANDROID_HOME C:\Users\nb14696\AppData\Local\Android\android-sdk\tools

应该是

ANDROID_HOME C:\Users\nb14696\AppData\Local\Android\android-sdk

虽然你必须有

%ANDROID_HOME%/tools and %ANDROID_HOME%/platform-tools

必须在您的路径中可用。一旦你解决了这个问题

android list target

以确认您拥有所需的目标。然后再次尝试构建命令

关于android - Cordova 构建在 superspawn.js 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23740097/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com