2014-03-02 61 views
1

我想在Windows 8上運行phonegame,並且當我輸入phonegap run android時,出現以下錯誤。任何想法如何解決它?我把一切準備好,的NodeJS,科爾多瓦等在Windows 8上Phonegap運行android錯誤

C:\Users\almeidamarcell\my-app>phonegap run android [phonegap] detecting Android SDK environment... [phonegap] using the local environment [phonegap] adding the Android platform... [error] An error occured during creation of android sub-project.

C:\Users\almeidamarcell.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q. js:126 throw e; ^Error: Failed to run 'java -version', make sure your java environment is set up including JDK and JRE. Your JAVA_HOME variable is undefined Error: Command failed: 'java' is not recognized as an internal or external comma nd,

operable program or batch file.

at C:\Users\almeidamarcell\.cordova\lib\android\cordova\3.3.0\bin\lib\check_ 

reqs.js:62:22 at ChildProcess.exithandler (child_process.js:641:7) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:743:16) at Socket. (child_process.js:956:11) at Socket.EventEmitter.emit (events.js:95:17) at Pipe.close (net.js:465:12)

C:\Users\almeidamarcell\my-app>phonegap run android

回答

2

我想你沒有安裝在您的計算機。如果它安裝,路徑設置不正確用java做。也給螞蟻的路徑。在完成這個之前,您需要添加Android SDk並通過SDK管理器準備Android目標。

我希望以下的參考可能會幫助你。

-JAVA_HOME (C:\Program Files\Java\jdk1.7.0_51) 
-ANT_HOME (C:\Program Files\apache\apache-ant-1.9.3) 
-ANDROID_HOME (C:\Program Files (x86)\Android\android-sdk\platform-tools) 
+0

感謝您的幫助。我做了你所說的一切,但現在我得到這個錯誤: http://pastebin.com/zGgLGWXr –

+0

我解決了上面的問題,下面的螞蟻安裝指南http://ant.apache.org/manual/index。 HTML。現在我得到了一個更小的錯誤。這我真的不知道如何解決它。 http://pastebin.com/Yv01Ku2s –

+0

它聽起來像螞蟻或Java沒有正確安裝。你有沒有在cmd中試過「javac」和「ant-v」或「ant-version」?如果cmd顯示錯誤,那麼你必須先修復它們。確保你已經安裝了android-sdk直到API19 .. – RamGrg