0

I am working on a Cordova plugin that offers a functionality for Android and iOS platforms. I also have a demo Cordova app to test out the plugin, when installed in the demo app the plugin works fine for the android platform but I cannot get the demo app to build for the iOS platform to build when the plugin is installed.

I get this error

"fatal error:'TestPlugin/TestPlugin.h' file not found"

Inspecting the plugins folder in the demo app. I've noticed that it seems the symlinks in an iOS framework which the plugin uses are completely missing leading me to believe that the framework was not properly moved. Also, I can get the demo app to run by manually moving the framework in question into the plugins folder of the demo app and running the app from Xcode.

I have tried the solution described here but it does not fix the issue(I think it might be only for fixing symlinks broken by windows), I am on a Mac running MacOS Sierra(version 10.12), Xcode 8.31 and Cordova version 7.

Oyebisi
  • 562
  • 2
  • 9
  • 23
  • I also tested [this](https://stackoverflow.com/questions/28974791/plugman-framework-skips-mac-os-x-symbolic-links) in both **after_plugin_add** and **before_plugin_install** folder hooks but the symlinks are broken inside the "platfors/ios/PROJECT_NAME/Plugins/.." folder. I am developing a plugin and I can't figure out a way to fix this without duplicating the files from my framework. – martin May 23 '17 at 15:35
  • I had something wrong when testing this. I added an answer with what worked for me. – martin May 23 '17 at 15:55

1 Answers1

0

This has actually worked for me. I did something different, though. I put my script under the before_plugin_install folder and created the symlinks from within the folder as follows:

#!/bin/sh
cd plugins/MY_PLUGIN/src/ios/MY_FWK.framework/
ln -s -f Versions/A/Headers/ Headers
ln -s -f Versions/A/MY_FWK MY_FWK
ln -s -f Versions/A/ Current
cd -

I gave the script execute permissions, removed the plugin and added it again. Cordova ended up copying the whole files of the framework (instead of keeping the symlinks) inside the project but the project works now.

[UPDATE]

Note that using the hooks folder is deprecated.

martin
  • 247
  • 3
  • 15