【问题标题】:Compilation fails on TACO 8.1 (Failed to fetch platform android)在 TACO 8.1 上编译失败(无法获取平台 android)
【发布时间】:2016-04-19 19:39:53
【问题描述】:

我今天升级到 TACO 8.1,清除了工具 > 选项中的 Cordova 缓存,克隆了我的 git 项目,现在在为 Android 编译时出现此错误:

1>  Executing "before_platform_add"  hook for all plugins.
1>  No version supplied. Retrieving version from config.xml...
1>  Failed to fetch platform android
1>  Probably this is either a connection problem, or platform spec is incorrect.
1>  Check your connection and platform name/version/URL.
1>MDAVSCLI : error : tunneling socket could not be established, cause=connect ECONNREFUSED

有什么想法吗?

  • 编辑:我没有代理
  • 编辑:为 iOS 编译时结果相同
  • 编辑:我尝试修复 Visual Studio:没有运气(同样的错误)
  • 编辑:我使用的是 Windows 8.1,Visual Studio 正在以管理员身份运行
  • 编辑:在构建 Visual Studio 附带的“Ionic Tabs App”项目时出现错误:

【问题讨论】:

  • 尝试通过工具菜单->选项->Apache Cordova 工具->Cordova 工具->清除 Cordova 缓存来清除 Cordova 缓存。
  • @ElvisXia 不幸已经做到了(见我的第一句话)。我实际上很想认为问题从此时开始出现。
  • 尝试新建一个空白项目看看发生了什么?但该错误似乎与 npm 更相关。
  • @AlanYao-MSFT 是的!请参阅下面的答案

标签: android cordova visual-studio-cordova


【解决方案1】:

哇,我刚刚解决了。忍受我。 This postthis post 让我走上了正轨。

我打开命令行并键入以下命令,以检查 Visual Studio 使用的npm 命令的配置:

cd C:\Users\Guillaume\AppData\Roaming\Microsoft\VisualStudio\MDA\vs-npm
npm config list

这是我得到的:

如您所见,指定了代理 URL (http://127.0.0.1:8888/)。 所以我使用这个命令删除了它,它解决了这个问题:

npm config rm proxy

我的猜测是,当 npm 第一次被 Visual Studio 安装或配置时,Fiddler 一定已经在运行了......

微软注意:在构建时最好使用当前的代理配置。此外,当从 Visual Studio 中清除 Cordova 的缓存时,应重置该设置...

【讨论】:

  • 您还可以通过转到工具 -> 选项 -> Apache Cordova 工具并取消选中“自动检测代理配置”复选框来关闭 VS TACO 中的自动代理功能。 (披露:我在 Visual Studio 中使用 Apache Cordova 工具)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-12-07
  • 2021-07-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-28
  • 2015-09-15
相关资源
最近更新 更多