简体   繁体   中英

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.

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
2. Download and install a git client.
And be sure you add them to Path in windows
3. Install the cordova
npm install -g cordova
4. Create app folder
cordova create hello com.example.hello HelloWorld
cd hello
5. Add Platforms
cordova platform add android
6. Build App
cordova build
7. Run app
cordova emulate android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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