简体   繁体   中英

Dependency issues with Dynamic Framework iOS

In my project I am using cocoa pods as dependency manager. I have added a static framework as my pod dependency (say Framework A).

Another framework (say Framework B) which is dynamic framework is embedded to my project.(It is not a pod dependency, directly linked and embedded with Xcode project.) The framework B has pod dependency of the Framework A which is a static framework and also added as a dependency to my main project.

In my framework B project, I have not chosen to embed the Framework A library.

Even though Framework A is not embedded to Framework B, all the calls to Framework A methods are not directed to the main project's dependency, instead it is directed like Framework A is part of Framework B and break points are not hit to the Framework A methods which is added as pod dependency.

My question is that, as the Framework A is static framework, even though it is not embeded, will it be copied as a dependency in compile time when Framework B is built ?

When you build an app or dynamic framework with a static dependency, all of the code of the static dependency is linked into the binary that is in the bundle. There is no need to also include the static framework as a resource that will be loaded at runtime.

This is my understanding of what you have

App
- Framework A (statically linked)
- Framework B (dynamic)
  - Framework A (statically linked)

If this is so, B has its own copy of A. Neither the app nor Framework B will look for Framework at runtime in the app bundle because they have a copy of the parts they need inside their own binary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM