Cordova error building on android platform: Comman

2019-09-18 19:57发布

问题:

I'm using cordova and android manager studio. Whenever I try the following, I get errors:

cordova emulate android

or

cordova run android

Whereas the same application works fine on browser.

So far, I've tried removing and adding the android platform back again (as it was recommended on the majority of posts I read) to no avail.

It throws the following error:

BUILD SUCCESSFUL

Total time: 1.871 secs Command finished with error code 0: cmd /s /c "C:\Users\Me\myFirstApp\platforms\android\gradlew.bat cdvBuildDebug -b C:\Users\Me\myFirstApp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true" Built the following apk(s): C:/Users/Me/myFirstApp/platforms/android/build/outputs/apk/android-debug.apk No scripts found for hook "before_deploy". ANDROID_HOME=C:\Users\Me\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 Running command: C:\Users\Me\AppData\Local\Android\sdk\platform-tools\adb.exe devices Command finished with error code 0: C:\Users\Me\AppData\Local\Android\sdk\platform-tools\adb.exe devices Running command: cmd "/s /c "C:\Users\Me\AppData\Local\Android\sdk\tools\android.bat list avds"" Command finished with error code 1: cmd /s /c "C:\Users\Me\AppData\Local\Android\sdk\tools\android.bat list avds" Error: cmd: Command failed with exit code 1 at ChildProcess.whenDone (C:\Users\Me\myFirstApp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:194:7) at maybeClose (internal/child_process.js:899:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Some information that may be helpful:

  • Windows 10 pro x64
  • Cordova 6.5.0
  • Node v7.8.0
  • Java JDK 1.8.0_121

  • Environment variables on path:

    C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Brackets\command;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\Me\AppData\Local\Android\sdk;C:\Users\Me\AppData\Local\Android\sdk\platform-tools;C:\Users\Me\AppData\Local\Android\sdk\tools;C:\Users\Me\AppData\Local\Microsoft\WindowsApps;C:\Users\Me\AppData\Roaming\npm

Any advice is greatly appreciated, thanks.