Visual Studio Home Visual Studio
SIGN UP Help shape the TACO tools and get access to early releases.

Cordova plugin Symlink fix for iOS plugins with custom frameworks

Updated: 9/10/2015

License: MIT

There are a small number of Cordova plugins that contain "custom framework" files for iOS. These use symlinks on OSX. Symlinks can break when the plugin is either downloaded on Windows and then moved to an OSX machine or when the plugin is pulled from the Cordova plugin repo / npm without the symlinks being present in the archive as described in this Cordova bug.

A telltale sign of this problem is the Cordova build for iOS reports missing "Header" files that are located inside one or more plugin paths.

However, there is a simple hook that can be added to your project to work around this issue.

To install it:

  1. Download hook-symlink-fix.js and drop it a hooks folder in your project root.
  2. Update config.xml with the following (using right-click->View Code):
  <hook type="before_compile" src="hooks/hook-symlink-fix.js" />
  1. Run a "Clean" operation in Visual Studio or remove the iOS platform, and then re-add it if you are using the command line.

Did you find this article helpful?

Thanks!

We're sorry to hear that! Feel free to email our team with your question.


Want FASTER answers? Our team monitors a special StackOverflow tag here.