无法添加Android平台 - ETIMEDOUT错误在下载模板 [英] Unable to Add Android Platform - ETIMEDOUT error while downloading Template
问题描述
我收到ETIMEDOUT错误,同时增加了Android平台,以现有的科尔多瓦的项目。
我有NPM HTTP和HTTPS代理配置正确的(我装科尔多瓦这种方式)。
但这样做时,科尔多瓦平台添加的android
我收到ETIMEDOUT网络超时错误。
无法继续,我尝试了所有可能的网络配置可以通过命令行/ IE浏览器选项。根据文档科尔多瓦二进制应该使用相同的网络HTTP / HTTPS NPM(Node.js的)的代理服务器配置
在一些研究(主要撞头),我发现了一个解决方法(但还是没能解决网络超时问题)。我不得不学习科尔多瓦实施添加平台,以更好的理解。
- 执行
科尔多瓦平台添加的Android --verbose
,这会给你,它会尝试连接,但无法输出网址 - 对于前 - 的的https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.2.0;sf=tgz - 在下载使用普通浏览器,有工作的互联网连接文件(科尔多瓦,Android的3.2.0-221b10b.tar.gz)。
- 打开一个文件的COM pression软件的文件(前 - 7zip的)。
- 这将包含另一个TAR文件(科尔多瓦,Android的3.2.0-221b10b.tar)
- 钻入TAR文件中查找一个文件夹(科尔多瓦,Android的3.2.0-221b10b)
- 命令
科尔多瓦平台添加的android
首先验证,如果这些文件是present在%HOME%\。科尔多瓦\ lib目录\机器人\科尔多瓦\ 3.2.0
文件夹之前它会尝试下载。 - 因此,从步骤#5的文件夹中的内容复制到该文件夹
%HOME%\。科尔多瓦\ lib目录\机器人\科尔多瓦\ 3.2.0
(箱,框架,测试的.gitignore,.reviewboardrc,许可...) - 在这个过程肯定适用于Windows 64位平台(32位复制到%USERPROFILE%.cordova \ lib目录\机器人\科尔多瓦\ 3.2.0)。对于基于Linux的机器,这应该是在主文件夹中当前用户太多。所以尝试。
- 重办
科尔多瓦平台添加的Android --verbose
这个时候应该说有关Android的科尔多瓦库已经存在。无需下载。继续。
- ,应继续为您的使用Android项目。
- 如果您遇到任何其他错误,请确保您有JAVA_HOME设置为JDK的文件夹和JDK文件夹\ bin在PATH环境变量可用。
I am getting ETIMEDOUT error while adding a platform android to an existing cordova project.
I have NPM HTTP and HTTPS proxy configured correct (I installed cordova that way).
But when doing cordova platform add android
I am getting ETIMEDOUT network timeout error.
Can't proceed and I tried all possible network configurations possible via command-line/IE Options. As per the documentation Cordova binary should use the same network http/https proxy configuration of NPM (Node.js)
After some research (Mostly head banging), I found a work-around (but still couldn't fix the network timeout issue). I had to study Cordova implementation for "add platform" to understand this better.
- Execute
cordova platform add android --verbose
and this will give you the output URL which it tries to connect but fails - For ex - https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.2.0;sf=tgz - Download this file (cordova-android-3.2.0-221b10b.tar.gz) using a regular browser which has working internet connection.
- Open the file in a File Compression Software (for ex - 7zip).
- This would contain another TAR file (cordova-android-3.2.0-221b10b.tar)
- Drill into the TAR file to find a folder (cordova-android-3.2.0-221b10b)
- The command
cordova platform add android
first verifies if these files are present at%home%\.cordova\lib\android\cordova\3.2.0
folder before it tries to download them. - So copy the contents of the folder from Step#5 into the folder
%home%\.cordova\lib\android\cordova\3.2.0
(bin, framework, test, .gitignore, .reviewboardrc, LICENSE...) - This process definitely works for Windows 64 bit platform (for 32 bit copy into %USERPROFILE%.cordova\lib\android\cordova\3.2.0). For Linux based machines this should be in the home folder for the current user too. So try that.
- Re-run
cordova platform add android --verbose
and this time it should saycordova library for "android" already exists. No need to download. Continuing.
- And should continue to create the Android project for your use.
- If you face any other errors, ensure that you have JAVA_HOME set to a JDK folder and JDK Folder\bin is available in the PATH environment variable.
这篇关于无法添加Android平台 - ETIMEDOUT错误在下载模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!