Cordova平台在windows7中添加android错误

时间:2014-02-18 16:25:15

标签: cordova

Cordova添加android平台会在我的windows7中引发错误。我确保我的所有路径都能正常工作。

  

java -version
  反转工作正常   android也运行正常

    C:\Users\kirthi\Hello>cordova -d platform add android
    cordova library for "android" already exists. No need to download. Continuing.
    Checking if platform "android" passes minimum requirements...
    Creating android project...
    Running bin/create for platform "android" with command: ""C:\Users\kirthi\.cordo
    va\lib\android\cordova\3.3.0\bin\create"  "C:\Users\kirthi\Hello\platforms\andro
    id" "com.hello.com" "HelloWorld"" (output to follow)

    Error: An error occured during creation of android sub-project.

    at C:\Users\kirthi\AppData\Roaming\npm\node_modules\cordova\src\platform.js:
    282:30        
    at exithandler (child_process.js:633:7)  
    at ChildProcess.errorhandler (child_process.js:649:5)  
    at ChildProcess.EventEmitter.emit (events.js:95:17)  
    at Process.ChildProcess._handle.onexit (child_process.js:795:12)  

1 个答案:

答案 0 :(得分:0)

如果在添加android平台时出错,您可以运行以下命令以获取有关错误的更多信息:

%userprofile%\.cordova\lib\android\cordova\3.3.0\bin\check_reqs.bat

在你的情况下:

  

'cscript'未被识别为内部或外部命令,   可操作程序或批处理文件

检查%systemdrive%\windows\system32文件夹中是否有cscript.exe,并且%systemdrive%\ windows \ system32在您的路径中(如果您的系统位于c盘中,您应该看到C:\ windows \ system32运行命令时的某个地方

set path

(当你修改它以添加ant和android sdk时,也许你搞砸了路径?)

  • 如果C:\ windows \ system32在路径中并且cscript.exe在此文件夹中,请尝试在shell中运行cscript并查看它输出错误
  • 如果C:\ windows \ system32不在路径中,则更正路径
  • 如果找不到C:\ windows \ system32 \ cscript.exe,可能是从Windows功能中卸载了Windows Scripting Host吗?