无法添加Android平台 - ETIMEDOUT错误在下载模板 [英] Unable to Add Android Platform - ETIMEDOUT error while downloading Template

查看:250
本文介绍了无法添加Android平台 - ETIMEDOUT错误在下载模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到ETIMEDOUT错误,同时增加了Android平台,以现有的科尔多瓦的项目。

我有NPM HTTP和HTTPS代理配置正确的(我装科尔多瓦这种方式)。

但这样做时,科尔多瓦平台添加的android 我收到ETIMEDOUT网络超时错误。

无法继续,我尝试了所有可能的网络配置可以通过命令行/ IE浏览器选项。根据文档科尔多瓦二进制应该使用相同的网络HTTP / HTTPS NPM(Node.js的)的代理服务器配置

解决方案

在一些研究(主要撞头),我发现了一个解决方法(但还是没能解决网络超时问题)。我不得不学习科尔多瓦实施添加平台,以更好的理解。

  1. 执行科尔多瓦平台添加的Andr​​oid --verbose ,这会给你,它会尝试连接,但无法输出网址 - 对于前 - 的https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.2.0;sf=tgz
  2. 在下载使用普通浏览器,有工作的互联网连接文件(科尔多瓦,Android的3.2.0-221b10b.tar.gz)。
  3. 打开一个文件的COM pression软件的文件(前 - 7zip的)。
  4. 这将包含另一个TAR文件(科尔多瓦,Android的3.2.0-221b10b.tar)
  5. 钻入TAR文件中查找一个文件夹(科尔多瓦,Android的3.2.0-221b10b)
  6. 命令科尔多瓦平台添加的android 首先验证,如果这些文件是present在%HOME%\。科尔多瓦\ lib目录\机器人\科尔多瓦\ 3.2.0 文件夹之前它会尝试下载。
  7. 因此,从步骤#5的文件夹中的内容复制到该文件夹​​%HOME%\。科尔多瓦\ lib目录\机器人\科尔多瓦\ 3.2.0 (箱,框架,测试的.gitignore,.reviewboardrc,许可...)
  8. 在这个过程肯定适用于Windows 64位平台(32位复制到%USERPROFILE%.cordova \ lib目录\机器人\科尔多瓦\ 3.2.0)。对于基于Linux的机器,这应该是在主文件夹中当前用户太多。所以尝试。
  9. 重办科尔多瓦平台添加的Andr​​oid --verbose 这个时候应该说

      

    有关Android的科尔多瓦库已经存在。无需下载。继续。

  10.   
  11. ,应继续为您的使用Android项目。
  12.   
  13. 如果您遇到任何其他错误,请确保您有JAVA_HOME设置为JDK的文件夹和JDK文件夹\ bin在PATH环境变量可用。
  14.   

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.

  1. 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
  2. Download this file (cordova-android-3.2.0-221b10b.tar.gz) using a regular browser which has working internet connection.
  3. Open the file in a File Compression Software (for ex - 7zip).
  4. This would contain another TAR file (cordova-android-3.2.0-221b10b.tar)
  5. Drill into the TAR file to find a folder (cordova-android-3.2.0-221b10b)
  6. 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.
  7. 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...)
  8. 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.
  9. Re-run cordova platform add android --verbose and this time it should say

    cordova library for "android" already exists. No need to download. Continuing.

  10. And should continue to create the Android project for your use.
  11. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆