VsTac task failed, could not find file appAsTgz.tgz when using global Cordova toolset

為{幸葍}努か 提交于 2019-12-01 04:30:00

Latest way to compile for iOS using Cordova and Visual Studio 2017 (15.5)

In Mac OS:

  • Install Xcode 9.*

  • Install Node.JS 6.*. (https://nodejs.org/dist/latest-v6.x/) - Newer NPM version doesn't work for now.

  • Install Xcode components via terminal: xcode-select -–install

  • Install "remotebuild" Microsoft tool for remote compile from Visual Studio (Windows): sudo npm install -g remotebuild

  • Install COCOA Pods (needed by newer Cordova 7.1.0): sudo gem install cocoapods

  • Setup COCOA Pods for your first use just running command (about 680 MB to download): pod setup

​ - Set permissions:

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

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

  • Start remotebuild to start listen: remotebuild

In Windows:

From

<vs:toolsetVersion>6.3.1</vs:toolsetVersion>

To

<vs:toolsetVersion>GlobalCordovaVersion</vs:toolsetVersion>

  • Remove the follow lines from config.xml (open using xml editor):

<engine name="android" spec="5.2.1" /> //if the file has another line with a newer version

<engine name="ios" spec="4.2.0" /> //if the file has another line with a newer version

<engine name="windows" spec="4.4.2" /> //if the file has another line with a newer version

<preference name="windows-target-version" value="10.0" /> //if the file has another line with a newer version

  • Setup Visual Studio (Tools > Options > Tools For Apache Cordova)​ with the config generated by remotebuild (running in Mac OS). Screen example: Remote Agent Output

    • Tip: Try a ping before configure. If you have a problem, use IP instead computer name.
  • Build. You can locate your *.ipa file in bin\iOS\Debug folder.

Yes it is possible and up until today I have been able to do this without too many problems however today I experienced the issue you have mentioned and I have spent all day trying to resolve it.

Unfortunately I cannot say exactly what caused it because I have been making lots of changes trying to resolve CORS issues after updating to use wkwebview for IOS (I am using Ionic framework by the way).

I have now resolved the issue after trying various things such as installing the latest updates for Visual Studio, trying to upgrade Node.js to the latest version (which I then had to revert back to version 6.12.0 due to problems with node-sass).

Again it is difficult to say exactly what fixed this because I have spent hours today trying various things in a panic to resolve the issue but I think it the solution was:

  1. Delete node_modules in my project
  2. Run npm install to rebuild the node_modules folder
  3. I also had to run npm install -g cordova@latest

This is due to a bug in NPM 5.5. I'm fairly certain it's related to this bug:

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

I installed NodeJS 6.* (and not the latest LTS 8.*) and the issue went away. Reinstalling 8.* causes the issue to creep up again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!