为cordova添加android平台时出错
D:\Shabbir\AndroidTest>cordova platform add android Creating android project... C:\Documents and Settings\avaya11\Application Data\npm\node_modules\cordova\node _modules\q\q.js:126 throw e; ^ Error: An error occured during creation of android sub-project. C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\node_mo dules\q\q.js:126 throw e; ^ Error: An error occurred while listing Android targets at C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\ lib\check_reqs.js:87:29 at _rejected (C:\Documents and Settings\avaya11\.cordova\lib\android\cordova \3.3.0\bin\node_modules\q\q.js:808:24) at C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\ node_modules\q\q.js:834:30 at Promise.when (C:\Documents and Settings\avaya11\.cordova\lib\android\cord ova\3.3.0\bin\node_modules\q\q.js:1079:31) at Promise.promise.promiseDispatch (C:\Documents and Settings\avaya11\.cordo va\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:752:41) at C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3.0\bin\ node_modules\q\q.js:574:44 at flush (C:\Documents and Settings\avaya11\.cordova\lib\android\cordova\3.3 .0\bin\node_modules\q\q.js:108:17) at process._tickCallback (node.js:415:13) at C:\Documents and Settings\avaya11\Application Data\npm\node_modules\cordo va\src\platform.js:244:30 at ChildProcess.exithandler (child_process.js:641:7) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:743:16) at Process.ChildProcess._handle.onexit (child_process.js:810:5) D:\Shabbir\AndroidTest>
这个错误,我得到了
我下载NodeJS并安装以下
npm -g install phonegap npm -g install cordova npm -g install plugman npm -g install ant
我为此设置了一些path
PATH C:\Documents and Settings\avaya11\Application Data\npm;C:\Documents and Settings\avaya11\Application Data\npm\node_modules\ant;C:\NEW ANDROID\sdk\platforms;C:\NEW ANDROID\sdk\platform-tools;C:\Documents and Settings\avaya11\Application Data\npm\node_modules\ant\bin;C:\Program Files\Java\jdk1.6.0_45\bin
这是我从这里下载的ANT_HOMEpath
ANT_HOME C:\Program Files\Java\apache-ant-1.9.3
还添加了JAVA_HOME,ANDROID_HOME
我尽一切可能的方式,但仍然发现PLZ的错误帮助我find解决办法,我想我困惑,设置一条path。
经过这么多的研究工作,我find了答案。
我没有设置xcopy的path。
xcopy.exe – this file contains sdk platform information.
所以我加了这个path。 xcopy.exe位于system32文件夹中。
所以我添加了这样的path,我可以添加Android平台。
%SYSTEMROOT%\ System32下;
这条道路问题
单击桌面左下angular的“开始”菜单,右键单击“计算机”,然后单击“属性”。
点击左边栏中的高级系统设置。
在出现的对话框中,按环境variables。
selectPATHvariables,然后按Edit。
例如,根据您安装SDK的位置将以下内容添加到PATH中
C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools
参考
这里的窗户
- 无法使用Cordova CLI 7.0.0添加平台
- NodeJS + SocketIO推送到移动应用程序
- 我应该从客户端发送并行请求,还是发送一个请求并在服务器上并行执行?
- Phonegap 3.0,Cordova CLI:创buildios子项目时发生错误
- 在android和nosejs之间通过套接字发送文件
- 如何使Android Java代码调用Node.js代码?
- 使用Node.jsencryption模块进行encryption并使用Java解密(在Android应用程序中)
- 离子运行android – 错误:找不到模块“内部/ fs” – 窗口
- 从android应用程序通过http发送JSONObject到node.js?