3

I currently have this code in my custom cordova plugin,

<framework src="src/ios/Frameworks/XXX.framework" custom="true" embed="true"/>
<framework src="src/ios/Frameworks/XXXFramework.framework" custom="true" embed="true"/>

When I cordova build ios it will only go into embedded binaries but not linked frameworks and libraries. I wish to import both of the framework to both linked and embedded sections.

Please refer to Image below : Image

Any help would be appreciated, thank you.

Brandon WongKS
  • 543
  • 6
  • 14
  • I've found the solution: [stackoverflow link](https://stackoverflow.com/questions/36650522/custom-cordova-plugin-add-framework-to-embedded-binaries/36723619) – Brandon WongKS Jan 12 '18 at 08:13
  • Can you please share how you implemented this? I used the hook in the link of the solution you mentioned, but it breaks the integrity of the xworkspace.project. – Logus Graphics Apr 13 '18 at 19:51
  • @Logus Hi, you can try Joanne's solution below. Or try this [link](https://github.com/gouen95/Plugman-ionic2-plugin-config#extra-2--add-framework-to-linked-and-embedded). The link is for my own and colleagues' reference, sorry if it's hard to understand. – Brandon WongKS May 07 '18 at 06:15
  • I solved it by using https://www.npmjs.com/package/xcode to add the framework with a simple method. – Logus Graphics Aug 03 '18 at 15:17

1 Answers1

5

For adding libraries to "Embedded Binaries" section in Xcode (Starting from cordova-ios 4.4.0 and cordova 7.0.0), put this in your plugin.xml:

<framework src="src/ios/XXX.framework"   embed="true" custom="true" />

For adding libraries to "Linked Frameworks and Libraries" section in Xcode, put this in your plugin.xml:

<source-file src="src/ios/XXX.framework" target-dir="lib" framework="true" />

Both of them can exist at the same time. For example:

<platform name="ios">
    ....
    <source-file src="src/ios/XXX.m"/>
    <source-file src="src/ios/XXX.framework" target-dir="lib" framework="true" />
    <framework src="src/ios/XXX.framework"   embed="true" custom="true" /> 
    ....  
</platform>
Joanne
  • 1,226
  • 13
  • 15