简体   繁体   English

Phonegap Cordova构建错误

[英]Phonegap cordova Build error

i need some help or suggestions. 我需要一些帮助或建议。 When i tried to build my phonegap application via cmd line i am having the error as shown below. 当我尝试通过cmd线构建我的phonegap应用程序时,出现如下所示的错误。

c:\myapplication>phonegap build android
[phonegap] executing 'cordova platform add --save android'...
[phonegap] completed 'cordova platform add --save android'
[phonegap] executing 'cordova build android'...
Running command: c:\myapplication\platforms\android\cordova\build.bat

ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_75

Running: c:\myapplication\platforms\android\gradlew cdvBuildDebug -b 


    c:\myapplication\platforms\android\build.gradleDorg.gradle.daemon=true

events.js:85
  throw er; // Unhandled 'error' event
        ^
 Error: spawn cmd ENOENT
      at exports._errnoException (util.js:746:11)
      at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
      at child_process.js:1144:20
      at process._tickCallback (node.js:355:11)

 ERROR building one of the platforms: Error:     

      c:\myapplication\platforms\android\cordova\build.bat: Command failed    
      with exit code 1
      You may not have the required environment or OS to build this project

      Error: c:\myapplication\platforms\android\cordova\build.bat: Command   
      failed with exit code 1 at ChildProcess.whenDone   


  (C:\Users\Owner\AppData\Roaming\npm\node_modules\phonegap\node_modules\c
   ordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
      at ChildProcess.emit (events.js:110:17)
      at maybeClose (child_process.js:1015:16)
      at Process.ChildProcess._handle.onexit (child_process.js:1087:5)


    c:\myapplication>

All tools required are correct but cannot figure out what might be the cause of this. 所需的所有工具都是正确的,但无法找出可能的原因。 Please help. 请帮忙。 Ideas are welcomed. 欢迎提出想法。

If you want to use command line I recommend you to use this documentation and follow steps 如果您想使用命令行,建议您使用本文档并按照以下步骤操作

Cordova Command Line Interface 科尔多瓦命令行界面

1. Download and install Node.js 1.下载并安装Node.js
2. Download and install a git client. 2.下载并安装git客户端。
And be sure you add them to Path in windows 并确保将它们添加到Windows中的“路径”中
3. Install the cordova 3.安装科尔多瓦
npm install -g cordova
4. Create app folder 4.创建应用程序文件夹
cordova create hello com.example.hello HelloWorld
cd hello
5. Add Platforms 5.添加平台
cordova platform add android
6. Build App 6.构建应用
cordova build
7. Run app 7.运行应用
cordova emulate android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM