在Windows 7上安裝Phonegap:命令'android'失敗

[英]Installing Phonegap on Windows 7 : The command 'android' failed


I followed the documentation and some tutorials on Phonegap to install it on Windows 7, but I'm stuck.

我按照文檔和Phonegap上的一些教程在Windows 7上安裝它,但是我被卡住了。

So far, I've installed Java 1.7.0_06, Ant-Apache 1.9.2, Eclipse, Android SDK with Android 4.3 (API 18), all Tools and all Extras in the SDK Manager), NodeJS 0.10.18 and Git.

到目前為止,我已經安裝了Java 1.7.0_06,Ant-Apache 1.9.2,Eclipse,Android SDK和Android 4.3(API 18),所有Tools和SDK Manager中的所有Extras,NodeJS 0.10.18和Git。

I wrote all paths in the PATH variables in Windows it's look like this (decomposed) :

我在Windows中的PATH變量中編寫了所有路徑,它看起來像這樣(已分解):

F:\nodejs;
F:\android-sdk\sdk\platform-tools;
F:\android-sdk\sdk\tools;
%JAVA_HOME%\bin;
%ANT_HOME%\bin;
C:\Program Files (x86)\Git\bin

Where %JAVA_HOME% and %ANT_HOME% have the right path, they give me the their version when I type java -version or ant -version in the CLI

%JAVA_HOME%和%ANT_HOME%具有正確的路徑,當我在CLI中鍵入java -version或ant -version時,它們會給我他們的版本

So I went in the CLI, I installed Phonegap with the following command :

所以我進入CLI,我使用以下命令安裝了Phonegap:

npm install -g phonegap

It give me the 3.0.0-0.14.3 version when I type phonegap -v.

當我輸入phonegap -v時,它給了我3.0.0-0.14.3版本。

Now, I went to my folder F:\apps and I created a new project with the following command :

現在,我轉到我的文件夾F:\ apps,然后使用以下命令創建了一個新項目:

phonegap create hello com.example.hello HelloWorld

Everything goes well, the files are created.

一切順利,文件被創建。

I went in the 'hello' folder, and I typed this command :

我進了'hello'文件夾,輸入了這個命令:

phonegap local build android

And there come the problem, I get this error :

出現問題,我收到此錯誤:

[phonegap] adding the Android platform...
[error] The command `android` failed. Make sure you have the latest AndroidSDK installed, and the `android` command (inside the tools/ folder) added to your path. Output:

I tried this command too :

我也試過這個命令:

phonegap build android

But it get stuck at this, nothing happen next :

但它陷入困境,接下來沒有任何事情發生:

[phonegap] detecting Android SDK environment...
[phonegap] using the remote environment
[phonegap] compressing the app...

After lot's of research, I don't know what I can do anymore to find the problem, and I'm quiet new with all this CLI... So yeah, do you have any idea why the command 'android' failed ?

經過大量的研究,我不知道我能做什么才能找到問題,而且我對所有這個CLI都很安靜......所以是的,你知道為什么“android”命令失敗了嗎?

Thanks

謝謝

1 个解决方案

#1


5  

Open environment variables, on the first part 'user variables' add new variable with this name android and the variable F:\android-sdk\sdk\tools;

打開環境變量,在第一部分'用戶變量'添加這個名稱為android的新變量和變量F:\ android-sdk \ sdk \ tools;

Then edit the user variables PATH and add this at end of the line %android%; close your CMD and try again.

然后編輯用戶變量PATH並將其添加到%android%行的末尾;關閉你的CMD然后再試一次。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2013/09/19/729e0201464fa1b831a2ed4a18618eab.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com