-
Notifications
You must be signed in to change notification settings - Fork 554
Conversation
+1 this fixes #115 |
+1 |
@josharian yes, this doesn't change that in any way. |
After further look @neonichu this particular pod spec brings a new issue into play
Seems to be consistent with this CocoaPods/CocoaPods#3194 |
@flippinjoe21 yes, you won't be able to use Pods which depend on CardIO when integrating with frameworks until it is a dynamic framework. It can however be used directly by apps. |
@burnto thoughts? |
+1 |
@neonichu forgive me if I'm wrong but I tried using your version of the Spec in a project that has a private Spec using CardIO as a dependency. This fails with the "target has transitive dependencies that include static binaries" error. Basically what I'm asking is: Is it possible to use a vendored library dependency across two or more pods? My setup is as follows:
This fails because the library is now linked to My understanding is that by using frameworks I can not have two or more pods that reference the same library? |
@danielgalasko to be used as a transitive dependency when integrating as frameworks, vendored libraries need to be dynamic. |
Thanks @neonichu! |
🍏 Looks reasonable to me. Thanks @neonichu |
Thanks, @burnto! |
does this merge mean we can use CardIO with use_frameworks! now? Because I tried using this commit on my Podfile like this: |
@jlubeck Yes it does, as long as its not a dependency for more than one of your pods. Try it on a new installation, its possible you might need to clean your project:) |
@danielgalasko I tried a brand new project which you can see here: https://github.com/jlubeck/CardIO-SwiftTest But it still doesn't work. Any ideas? Thanks! |
Hmm @jlubeck So I think you're misunderstanding what actually happens with the vendored_libraries. All this does is tell any libraries defined in the vendored_libraries to be linked in to the top-level project so that the symbols can be found. This does not create a module. Because you cannot include static library within a .framework. So in order to have your project work the way you expect. You would have to have a bridging header, and |
Ok, I must've missunderstood. I used the bridging header and everything works fine with that. Will it ever work without the header and just an Thanks! |
I'm not 100% sure. That is up to the cocoa pods team. There is a discussion about handling it here. |
I'm slightly confused. What then is the difference between a pod that has vendored_libraries set to a .a file and has public_header_files set to a collection of headers compared with a pod that sets the preserve_paths to a .a file, libraries set to the name of that .a file (which sets the OTHER_LINKER_FLAGS), and finally sets the xcconfig LIBRARY_SEARCH_PATHS to point to the path to the .a and header files? It is my understanding that vendored_libraries signals to CocoaPods that "the library is to be linked in to the top-level project so that symbols can be found", without creating a module, which can't be used within the context of a dynamic dependency (framework). I'm assuming that without vendored_libraries set, this linking to the top-level project will not happen for the second scenario. Is the second scenario considered a "fake" framework? If so, I was under the impression that they couldn't be used when integrating with dynamic dependencies. I have a situation where a dynamic dependency requires Google Analytics, which is currently still a vendored library, while also requiring CrittercismSDK, which isn't a vendored library but instead has a podspec similar to the second scenario mentioned above. Google Analytics throws the transitive dependency contains static binary error during a pod install on an iOS app that has a dependency on a dynamic framework which has the dependency on Google Analytics. However, CrittercismSDK, which is a sibling of GA in my dependency tree, is not throwing any such errors and appears to be fine (this is with CocoaPods 0.39 and use_frameworks!). GoogleAnalytics 3.14: https://github.com/CocoaPods/Specs/blob/master/Specs/GoogleAnalytics/3.14.0/GoogleAnalytics.podspec.json CrittercismSDK 5.4.5: https://github.com/CocoaPods/Specs/blob/master/Specs/CrittercismSDK/5.4.5/CrittercismSDK.podspec.json |
More context about not being able to import CardIO from Swift here: #115 (comment) |
I've submitted a simple PR that accomplishes this #210 I will probably delete this fork regardless of whether or not the PR is merged so please do not depend on it in your projects. |
This is the right way to ship a prebuilt library as a Pod. Once CocoaPods/CocoaPods#3859 is merged, this will mean that CardIO also works fine when users are integrating with
use_frameworks!
cc @keith