我的科爾多瓦程序在瀏覽器中執行時沒有生成錯誤。當我嘗試通過調試版本發給我的Android手機設備(F5)我得到的輸出窗口此版本錯誤:MSBUILD:cordova-build錯誤:錯誤:cmd:命令失敗,退出代碼ENOENT
MSBUILD : cordova-build error : Error: cmd: Command failed with exit code ENOENT
的消息,將其從輸出窗口失敗:
You have been opted out of telemetry. To change this, run: cordova telemetry on.
No scripts found for hook "before_compile".
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_131
Reading build config file: C:\Users\S50A\Documents\Visual Studio 2017\Projects\ClockJsAN\ClockJsAN\build.json
Running command: cmd "/s /c ""C:\Users\S50A\Documents\Visual Studio 2017\Projects\ClockJsAN\ClockJsAN\platforms\android\gradlew.bat" cdvBuildDebug -b "C:\Users\S50A\Documents\Visual Studio 2017\Projects\ClockJsAN\ClockJsAN\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true""
Command finished with error code ENOENT: cmd /s /c ""C:\Users\S50A\Documents\Visual Studio 2017\Projects\ClockJsAN\ClockJsAN\platforms\android\gradlew.bat" cdvBuildDebug -b "C:\Users\S50A\Documents\Visual Studio 2017\Projects\ClockJsAN\ClockJsAN\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1>MSBUILD : cordova-build error : Error: cmd: Command failed with exit code ENOENT
1>Done building project "ClockJsAN.jsproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
很明顯,從上面哪個命令失敗了,但不清楚如何解決它。 ENOENT似乎意味着沒有發現任何東西。
(即cmd/s/c ...產生錯誤)。
我注意到我沒有安裝在config.xml中的插件。這可能是它正在尋找什麼?我還注意到,當我嘗試通過config.xml安裝Cordova Media Plugin時,出現同樣的錯誤。請指教...
感謝andreszs的建議,在乾淨安裝後,我能夠創建一個新的空白的Cordova應用程序。我現在只使用Visual Studio中的默認工具和額外選項來編寫我可以編寫的Apache Cordova應用程序。 (我正在運行Android Studio的默認安裝,並且沒有干擾) – pollaris