问题描述
我正在尝试使用 Cordova 创建一个 Android 项目,但是我收到了一个 ENOENT 错误,尽管我非常小心地一步一步地遵循了教程,这让我很生气.首先这是错误的屏幕截图:以下是有关我的软件和硬件/操作系统的信息:
I am trying to create an Android project with Cordova, however i am getting an ENOENT error although i followed the tutorial step by step very carefully, this is getting me angry.First this is the screenshot of the error:Here are information about my software and hardware/os:
硬件和操作系统:
- Intel(R) Core(TM) i5-3230M CPU @ 2.60 GHz 2.60GHz
- 4 GB 内存
- 64 位操作系统,基于 x 64 的处理器
- Windows 8
软件:下面是我的一些相关软件的命令行输出.
Software:Here are some of the outputs of my command line for the related software.
- $ npm -version
- 输出:1.4.8
- $cordova -version
- 输出:3.4.1-0.1.0
- $ ant -version
- 输出:2013 年 12 月 23 日编译的 Apache Ant(TM) 版本 1.9.3
- $ java -version
- $ adb 版本
- 输出:Android Debug Bridge 版本 1.0.31
以下是我的一些系统变量:
- ANDROID_HOME:C:adt-bundle-windows-x86_64-20140321sdk
- ANT_HOME:C:apache-ant-1.9.3
- JAVA_HOME:C:Program FilesJavajdk1.8.0_05
- 类路径:%JAVA_HOME%jrelib
路径:%JAVA_HOME%in;C:apparisaproduct11.2.0dbhome_1in;C:Program文件 (x86)InteliCLS Client;C:Program FilesInteliCLSClient;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:ProgramFilesIntelIntel(R) Management Engine ComponentsDAL;C:ProgramFilesIntelIntel(R) Management Engine ComponentsIPT;C:Program文件 (x86)IntelIntel(R) 管理引擎组件DAL;C:Program Files (x86)IntelIntel(R) Management引擎组件IPT;C:Program FilesMicrosoftWeb Platform安装程序;C:Program Files (x86)Microsoft ASP.NETASP.NET WebPagesv1.0;c:Program Files (x86)Microsoft SQLServer100ToolsBinn;c:Program FilesMicrosoft SQLServer100ToolsBinn;c:Program FilesMicrosoft SQLServer100DTSBinn;C:Program Files (x86)Windows Kits8.0Windows性能工具包;C:Program Files (x86)Microsoft SQLServer80ToolsBinn;C:Program FilesMicrosoft SQLServer90Toolsinn;C:Program Files (x86)Microsoft SQLServer90Toolsinn;C:Program Files (x86)Microsoft SQL服务器90DTSBinn;C:Program Files (x86)Microsoft SQLServer90ToolsBinnVSShellCommon7IDE;C:Program Files(x86)Microsoft Visual Studio8Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQLServer100ToolsBinnVSShellCommon7IDE;C:Program Files(x86)Microsoft Visual Studio9.0Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQL Server100DTSBinn;C:Program FilesMicrosoft SQL服务器110DTSBinn;C:Program Files (x86)Microsoft SQLServer110ToolsBinn;C:Program FilesMicrosoft SQLServer110ToolsBinn;C:Program Files (x86)Microsoft SQLServer110ToolsBinnManagementStudio;C:Program Files(x86)Microsoft Visual Studio10.0Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQL服务器110DTSBinn;%ANT_HOME%in;C:adt-bundle-windows-x86_64-20140321sdkplatform-tools;C:adt-bundle-windows-x86_64-20140321sdkools;C:程序文件odejs
- ANDROID_HOME: C:adt-bundle-windows-x86_64-20140321sdk
- ANT_HOME: C:apache-ant-1.9.3
- JAVA_HOME: C:Program FilesJavajdk1.8.0_05
- CLASSPATH: %JAVA_HOME%jrelib
PATH:%JAVA_HOME%in;C:apparisaproduct11.2.0dbhome_1in;C:ProgramFiles (x86)InteliCLS Client;C:Program FilesInteliCLSClient;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:ProgramFilesIntelIntel(R) Management Engine ComponentsDAL;C:ProgramFilesIntelIntel(R) Management Engine ComponentsIPT;C:ProgramFiles (x86)IntelIntel(R) Management EngineComponentsDAL;C:Program Files (x86)IntelIntel(R) ManagementEngine ComponentsIPT;C:Program FilesMicrosoftWeb PlatformInstaller;C:Program Files (x86)Microsoft ASP.NETASP.NET WebPagesv1.0;c:Program Files (x86)Microsoft SQLServer100ToolsBinn;c:Program FilesMicrosoft SQLServer100ToolsBinn;c:Program FilesMicrosoft SQLServer100DTSBinn;C:Program Files (x86)Windows Kits8.0WindowsPerformance Toolkit;C:Program Files (x86)Microsoft SQLServer80ToolsBinn;C:Program FilesMicrosoft SQLServer90Toolsinn;C:Program Files (x86)Microsoft SQLServer90Toolsinn;C:Program Files (x86)Microsoft SQLServer90DTSBinn;C:Program Files (x86)Microsoft SQLServer90ToolsBinnVSShellCommon7IDE;C:Program Files(x86)Microsoft Visual Studio8Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQLServer100ToolsBinnVSShellCommon7IDE;C:Program Files(x86)Microsoft Visual Studio9.0Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQL Server100DTSBinn;C:Program FilesMicrosoft SQLServer110DTSBinn;C:Program Files (x86)Microsoft SQLServer110ToolsBinn;C:Program FilesMicrosoft SQLServer110ToolsBinn;C:Program Files (x86)Microsoft SQLServer110ToolsBinnManagementStudio;C:Program Files(x86)Microsoft Visual Studio10.0Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQLServer110DTSBinn;%ANT_HOME%in;C:adt-bundle-windows-x86_64-20140321sdkplatform-tools;C:adt-bundle-windows-x86_64-20140321sdkools;C:ProgramFilesodejs
注意:我把tools.jar从jdk/lib复制到jre/lib互联网上的研究.不工作.
Note: I copied the tools.jar from jdk/lib to jre/lib after someresearch on the internet. Not working.
注2:我给命令cdC:Usersarisa.cordovalibandroidcordova3.4.0in" 有一个该文件夹中的 check_reqs 文件.但是,如果我在命令行它说check_reqs 不被识别为内部或外部命令...."
Note 2: I give the command "cdC:Usersarisa.cordovalibandroidcordova3.4.0in" There is acheck_reqs file in that folder. However if i type $ chek_reqs in thecommand line it says "check_reqs is not recognized as an internal orexternal command ...."
注 3:我通过右键单击打开命令提示 (cmd) -> run as管理员我该怎么办?
Note 3: I opened command propmt (cmd) by right click -> run asadministrator What should i do?
带有 -d 标志的额外信息:
Extra information with -d flag:
我清理了 .cordova 并重新安装了它,现在,我收到此错误:
I cleaned .cordova and reinstalled it and now, i am getting this error:
我的变量定义如上所示.
My variables are defined as indicated above.
推荐答案
如果您确定自己的路径,请尝试在 cmd 中键入 android,如果它显示:'xcopy' 未被识别.
If you are sure of yours paths try to type android in cmd if it says: 'xcopy' was not recognized.
然后添加到您的路径:
%SystemRoot%system32; %SystemRoot%; %SystemRoot%System32Wbem;
在某些情况下,不要忘记重启电脑.
In certain cases, don't forget to reboot the PC.
这篇关于Cordova 无法添加 Android 失败,退出代码为 ENOENT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!