I am currently making a plugin for phonegap 3. I have a custom framework to copy using the source-file directive. In the plugin.xml I tried:
<source-file src="libs/ios/mylib.framework" />
but I get the error when I add the plugin to my project:
mylib.framework is a directory (not copied)
I tried to copy the framework file by file but it is going in the wrong directory.
How can I copy a custom ios framework using the plugin.xml file?
You can copy the binary file (who should be in "mylib.framework/Versions/A/") and the headers ( ".h" who should be in "mylib.framwork/Versions/A/Headers")
like this
<source-file src="libs/ios/mylib.framework/Versions/A/mylibBinary" framework="true" />
<header-file src="libs/ios/mylib.framework/Version/A/Headers/mylibHeader.h" />
...
You also have to add the dependencies manually, IE.: this framework needs the iOS AVFoundation.framework
so, you need to add this too.
<framework src="AVFoundation.framework" />
One more thing you have to know, if you want to submit this plugin to PhoneGap.
Any application that contains binary libraries will be rejected. This is because we need to be able to see exactly what is in a plugin as part of our code review process. So when submitting a plugin make sure that it doesn’t contain binary libraries. (PhoneGap)
Good news: it seems that the Cordova folks are working on this as we speak. There is a feature request as well as a commit to GitHub that claims to resolve this issue. The framework
tag will support the custom="true"
attribute. For example, here's how you could do it for the AWS iOS SDK Runtime framework:
<framework src="src/ios/Frameworks/AWSRuntime.framework" custom="true" />
UPDATE: It seems that this change made it into the current stable release of Cordova on 11/29/2013 (two days ago). Just update your Cordova and Plugman binaries and you should be good to go.
$ npm update -g cordova # if using `cordova plugin add xyz`
$ npm update -g plugman # if using `plugman install --platform x --project y --plugin z`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With