繁体   English   中英

在Phonegap中运行android时出错

[英]error running android in Phonegap

我在安装Phonegap android软件包时遇到问题。 我看了其他stackoverflow问题,但不清楚问题到底是什么。 我得到的错误代码是:

[phonegap] using the local environment
[phonegap] adding the Android platform...

C:\Users\chad\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126

                throw e;
                      ^
Error: ERROR : executing command 'ant', make sure you have ant installed and add
ed to your path.
at C:\Users\chad\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.j
s:47:27
at exithandler (child_process.js:643:7)
at ChildProcess.errorhandler (child_process.js:659:5)
at ChildProcess.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:807:12)
{ [Error: C:\Users\chad\.cordova\lib\android\cordova\3.5.0\bin\create.bat: C
ommand failed with exit code 8] code: 8 }
[error] C:\Users\chanukya\.cordova\lib\android\cordova\3.5.0\bin\create.bat:
Command failed with exit code 8

我发现如果我们安装了android sdk和java jre并设置了路径,则不需要安装apache int。 如果您有任何线索,请告诉我。 安装ant并设置路径变量后,如下所示。

ANT_HOME = C:\Program Files\apache-ant-1.9.4-bin\apache-ant-1.9.4
PATH = C:\Program Files\apache-ant-1.9.4-bin\apache-ant-1.9.4\bin;

给我

Files was unexpected at this time.

能否让我知道路径变量是否有问题。 当我运行ant命令时,从cmd添加更多内容

C:\Users\chan>if "C:\Users\chan" == "" goto homeDrivePathPre
C:\Users\chan>if exist "C:\Users\chan\antrc_pre.bat" call "C:\Users\chan\antrc_pre.bat"
C:\Users\chan>if "C:\Users\chan" == "" goto userProfilePre
C:\Users\chan>if "C:\Users\chan" == "C:\Users\chan" goto userProfile
Pre
C:\Users\chan>if "C:\Users\chan" == "" goto alpha
C:\Users\chan>if "C:\Users\chan" == "C:\Users\chan" goto alpha
C:\Users\chan>if "Windows_NT" == "Windows_NT"
C:\Users\chan>if "Windows_NT" == "WINNT"
C:\Users\chan>if "C:\apache-ant-1.9.4" == "" goto setDefaultAntHome
C:\Users\chan>if not _4 == _\ goto checkClasspath
C:\Users\chan>set _USE_CLASSPATH=yes
C:\Users\chan>rem CLASSPATH must not be used if it is equal to ""
Files was unexpected at this time.
C:\Users\chan>if ".;"C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip";C:
\Program Files (x86)\Java\jre7\lib\ext\QTJava.zip"=="""" set _USE_CLASSPATH=no

请安装Ant并在环境变量中设置Ant路径和SDK路径。 还请确保您已更新SDK。

科尔多瓦(android):在侦听Android目标时发生错误

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM