我想在我的Windows 7機器上使用cordova創建我的第一個android項目。我已經安裝了最新的Android SDK和cordova。我爲ANDROID_PATH,ANDROID_PLATFORM_TOOLS,ANDROID_TOOLS和ANT_HOME設置了路徑。從http://cordova.apache.org/docs/en/3.6.0//guide_cli_index.md.html#The%20Command-Line%20Interface我創立了「你好」的項目,但作爲 使用方向我嘗試使用添加Android平臺:cordova平臺添加android在不同的窗口中啓動android
cordova platform add android
從我的命令提示符Android模擬器打開了顯示Android主屏幕上,這樣我就可以通過OS導航但很快關閉它我得到的輸出:
C:\devCenter\private\hello>cordova platform add android
Creating android project...
C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:126
throw e;
^
Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
at C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\lib\check_reqs.js:173:19
at _fulfilled (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:7
at C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:574:44
at flush (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\think ahead\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
C:\devCenter\private\hello>
「hello」項目中沒有在平臺內創建的android目錄。有人可以幫助我指出我錯過/做錯了什麼。
編輯: 我已經更新SDK與API-19,但我仍然遇到同樣的問題。還有什麼我需要做的嗎?
它清楚地表明你需要安裝Android SDK版本19.'錯誤:請安裝Android目標「android-19」。 提示:從命令行運行「android」以打開SDK管理器。# – frank 2014-10-05 09:22:35
我將SDK更新爲API-19,但我仍然收到相同的錯誤,是否還需要執行更多操作? – vikramaditya234 2014-10-05 13:56:06