Cordova plugin Symlink fix for iOS plugins with custom frameworks

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" />
  3. Run a "Clean" operation in Visual Studio or remove the iOS platform, and then re-add it if you are using the command line.