Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants