Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13043

Cordova generated app broken if the plugin is a dynamic framework that depends on Cordova



    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.4.0
    • Fix Version/s: None
    • Component/s: cordova-ios
    • Labels:
    • Environment:

      iOS 10


      I have a plugin that's directly dependent on Cordova since it contains a subclass of CDVViewController and it references other native Cordova classes. I'm trying to package this framework as a dynamic framework and bundle it in my plugin. The problem with this is that it has to be linked to Cordova.framework but the generated app from Cordova CLI links to libCordova.a which causes symbol conflicts. The basic problem is that a dynamic framework has a defined boundary and is self-sufficient, which prevents it from getting symbols from the external libCordova.a. It also can't weak-link to a static lib. The fix here would be to do 1 of the following:

      1) In the generated app, make Cordova's dynamic framework target a dependency instead of the static target like it is currently. Also, link to Cordova.framework instead of libCordova.a.

      2) Allow a parameter to be set in the plugin, called "dynamic" or something to that effect that allows a plugin to specify that it needs Cordova as a dynamic framework dependency. Setting this parameter would basically make Cordova do (1).

      Since Apple has moved away from static libs and is recommending dynamic frameworks, I would recommend approach (1).




            • Assignee:
              shazron Shazron Abdullah
              bhariharan Bharath Hariharan
            • Votes:
              0 Vote for this issue
              6 Start watching this issue


              • Created: