VsTac任务失败,在使用全局Cordova工具集时找不到文件appAsTgz.tgz

当我使用全局安装的Cordova 7.1.0工具集并进行iOS远程构建(模拟器或本地设备)时,我几乎立即收到错误消息:

Error MSB4018 The "VsTac" task failed unexpectedly. System.IO.FileNotFoundException: Could not find file 'C:\Users\joe\AppData\Local\Temp\appAsTgz.tgz'. File name: 'C:\Users\joe\AppData\Local\Temp\appAsTgz.tgz' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at Microsoft.VisualStudio.MultiDeviceHybridApps.MdaBuildTasks.RemoteBuild.AppAsTgzStream(String changeTimeFile, JObject lastChangeTimesMap) at Microsoft.VisualStudio.MultiDeviceHybridApps.MdaBuildTasks.RemoteBuild.Build() at Microsoft.VisualStudio.MultiDeviceHybridApps.MdaBuildTasks.VsTac.BuildPlatform() at Microsoft.VisualStudio.MultiDeviceHybridApps.MdaBuildTasks.VsTac.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() MyFleetGoTest C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets 256 

我可以做iOS和Android浏览器构建。 我可以将工具集更改为6.3.1 ,错误消失,消息成功。

是否可以使用全局Cordova 7.1.0安装而不是VS TACO 6.3.1工具集并获得有效的iOS远程构建? 这是Visual Studio 2017。

使用Cordova和Visual Studio 2017编译iOS的最新方法(15.5)

在Mac OS中:

  • 安装Xcode 9. *

  • 安装Node.JS 6. *。 ( https://nodejs.org/dist/latest-v6.x/ ) – 较新的NPM版本暂时不起作用。

  • 通过终端安装Xcode组件: xcode-select –install

  • 从Visual Studio(Windows)安装“remotebuild”Microsoft工具进行远程编译: sudo npm install -g remotebuild

  • 安装COCOA Pods(需要更新的Cordova 7.1.0): sudo gem install cocoapods

  • 首次使用COCOA Pods运行命令:(约500 MB下载): pod设置

– 设置权限:

sudo chown -R $ USER:$ GROUP~ / .npm

sudo chown -R $ USER:$ GROUP~ / .config

  • 启动remotebuild开始监听: remotebuild

在Windows中:

6.3.1

GlobalCordovaVersion

  • 从config.xml中删除以下行(使用xml编辑器打开):

//if the file has another line with a newer version

//if the file has another line with a newer version

//if the file has another line with a newer version

//if the file has another line with a newer version

  • 使用remotebuild生成的配置(在Mac OS中运行)设置Visual Studio(工具>选项>适用于Apache Cordova的工具)。 屏幕示例: 远程代理输出

    • 提示:在配置之前尝试ping。 如果您遇到问题,请使用IP代替计算机名称。
  • 建立。 您可以在bin \ iOS \ Debug文件夹中找到* .ipa文件。

是的,这是可能的,直到今天我能够做到这一点没有太多的问题,但今天我遇到了你提到的问题,我花了一整天时间试图解决它。

不幸的是,我无法确切地说是什么导致了它,因为我在更新后使用wkwebview for IOS(我正在使用Ionic框架)尝试解决CORS问题时进行了大量更改。

我现在已经解决了这个问题,尝试了各种各样的事情,例如安装Visual Studio的最新更新,尝试将Node.js升级到最新版本(由于node-sass的问题,我不得不恢复到版本6.12.0 )。

再次很难确切说明是什么解决这个因为我今天花了几个小时在恐慌中尝试各种事情来解决问题,但我认为解决方案是:

  1. 删除项目中的node_modules
  2. 运行npm install以重建node_modules文件夹
  3. 我还必须运行npm install -g cordova @ latest

这是由于NPM 5.5中的错误。 我很确定它与这个bug有关:

https://github.com/npm/npm/issues/17858

我安装了NodeJS 6. *(而不是最新的LTS 8. *),问题就消失了。 重新安装8. *会导致问题再次出现。