Creating Framework That Requires (Depends On) Another Framework

Creating framework that requires (depends on) another framework

Frameworks should never embed other frameworks directly. This leads to collisions if the importing project or any other framework also includes that framework. Instead, you need to tell your consumer that they also need to include your dependency. CocoaPods will do this for you automatically, so you should let it. (If you're having trouble with CocoaPods dependencies, you should ask a question about that and get it cleared up. The whole point of CocoaPods is to manage these kinds of things.)

Note that I will be releasing the Swift version of RNCryptor into beta today (or tomorrow, but I really hope today). This version bridges to ObjC and will be the preferred version going forward. (The ObjC version will continue to be available of course for projects that cannot or don't want to include Swift.)

handling dependencies for iOS Framework project

For the use case you are describing, you should be linking to these external libraries from your application, NOT your own framework. It can be one or the other, but it can't be both.

If you decide that these dependancies belong as the responsibility of the application, you would remove them from "Link Binary With Libraries" and any other explicit linking configuration, and just project your framework project with the path to these frameworks and libraries so it can find the symbols (but not link against them) at compile time (i.e. the path to the libraries should be included LIBRARY_SEARCH_PATHS).

Framework contains code references to another framework

Solution was to make the third-party framework project a dependent sub-project to my framework project. I'll leverage dependency managers to make it so the developer users of my framework don't have to deal with downloading and integrating the third-party framework.

How to generate a .framework depending from another with Kotlin/native?

You cannot create multiple Kotlin iOS frameworks and use them in the same project interchangeably. When the Kotlin compiler creates an iOS framework, it is its "own world", as in it includes everything you need (dependencies, etc). It's one big binary.

The summary is, the config you want is not possible. You can use multiple Kotlin iOS frameworks in the same project, but they need to be fully independent. They won't be able to communicate with each other.



Related Topics



Leave a reply



Submit