Cordova - Error: cmd: Command failed with exit code 1

霸气de小男生 提交于 2019-12-21 06:39:30

问题


when we try to run android it always give error on new created project on cordova

D:\Android\Theplug>cordova run android
ANDROID_HOME=D:\Android\android-sdk-windows
JAVA_HOME=C:\Program Files\java\jdk1.8.0_111
The system cannot find the path specified.
Error: cmd: Command failed with exit code 1

Cordova requirements:

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed Google Inc.:Google APIs:24,Google Inc.:Google APIs:23,
Google Inc.:Google APIs:22,Google Inc.:Google APIs:21,android-25,android-24,android-23,
android-22,android-21
Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle

回答1:


just downgrade your android version to 5


cordova platform rm android

then

cordova platform add android@~5

it worked for me.



来源:https://stackoverflow.com/questions/44322400/cordova-error-cmd-command-failed-with-exit-code-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!