I created an iOS framework that uses a library (RestKit) via CocoaPods. In the application project that uses my framework I also use CocoaPods to include other libraries. I had to include the library from the framework as the project didn't compile otherwise.
Everything works fine, but as expected when I launch the application I get: Class X is implemented in both /private/var/mobile/Containers/Bundle/Application/[...]/Application.app/Frameworks/Framework.framework/Framework and /private/var/mobile/Containers/Bundle/Application/[...]/Application.app/Application. One of the two will be used. Which one is undefined." in several classes from the libraries.
Is there any way in CocoaPods or in the build process to prevent having duplicate libraries when they're already being used?
Some more context to my question. Here's what I did:
Created a framework project as a Cocoa Touch Framework. Initially I added just a Podfile with a dependency for RestKit as following:
pod 'RestKit', '~>0.23'
Then I removed the Podfile and just added a podspec as in the comment by @Paula Chavarría.Created the app project. Added a Podfile with other dependencies and also the dependency to the framework as @Paula Chavarría also mentioned.
When I build the app project the framework fails building because it can't find the right headers. I changed the header search path for the framework but it doesn't seem to be enough for the build to be successful.
Do I need to have also a Podfile in the framework? As I said in my original question, I did that at first and I ended up having duplicate libraries and that's what I'm trying to avoid in the first place. Is there any way to tweak the Podfile or the configurations generated by it and use the headers in the app and link with the libraries in the app? What am I missing here?... Thanks in advance! :)