Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Can I use cocoapods in my framework? #111

Open
wenzhaot opened this issue Jul 16, 2015 · 4 comments
Open

Can I use cocoapods in my framework? #111

wenzhaot opened this issue Jul 16, 2015 · 4 comments

Comments

@wenzhaot
Copy link

Can I use cocoapods in my framework?

@jonathanpdiaz
Copy link

Based on my experience:
You can, but you can not ship static Libs inside your static lib.
So, you has to remove the reference to the libPod.a to be able to compile and build the .framework.
Then, you have to notify to the user of your framework that you have dependencies. That need to be installed using cocoa pods.
Hope it helps. Good luck!

@wenzhaot
Copy link
Author

I have a project A, I drag a static lib project B to A for build framework, and I use cocoapods in project A, so the question is Can I use cocoapods libs in static lib project B ?

@jonathanpdiaz
Copy link

I did something that sounds like that, this was my setup:
Project A, main Project with cocoa pods. (demo app for my framework)
Project B, Framework using cocoa pods. (that builds the .framework fat file)

Since the framework is basically a static lib, I can not add libs (libPod.a is a static lib) inside. It won't compile. But, what I can do is use cocoa pods to write the framework code (having access to the dependencies headers), but to make it work I need to remove the libPod.a dependency from "Link Binary with Libraries" in the project B. That way, I have access to the headers of the libs from cocoa pods but when you build your .Framework it won't complain about trying to ship a lib with a lib inside.

Be aware that each time you run pod install, the libPod.a will be re linked to your project.

Then, in the podfile in project A, I need to set the same dependencies that I had in podfile in project B and it should build without problem. Then, I publish in cocoa pods the Public Headers and the .framework file setting the dependencies to make it work.

Again, hope it helps.
Big thanks to the guys that wrote iOS-Framework!

@wenzhaot
Copy link
Author

https://github.com/wenzhaot/RW-iOSFramework
This is a demo project, Can u help me?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants