-
Notifications
You must be signed in to change notification settings - Fork 553
not able to use CardIO.framework , gives linker error #276
Comments
Can you add a sample project that reproduces the issue? |
@keith please find the test project here - https://github.com/jamehta/Modules - Here TestProjTestApp uses framework TestProjFramework which uses CardIO framework. When you build the TestProjTestApp, you will see below linker error. My end goal is both TestProjFramework and TestProjTestApp build should succeed. |
The problem here is that since you want CardIO to be a dependency of both your app, and a dynamic framework, CocoaPods will refuse to do this since that would result in 2 copies of CardIO being bundled with your app. The solution to this is to either remove the dependency on CardIO from one of the places, or to change your dynamic framework into a static framework or static library. As of CocoaPods 1.4.0 they now support a spec attribute for forcing your pod to use a static framework instead of a dynamic library, this should help. http://blog.cocoapods.org/CocoaPods-1.4.0/ |
Thanks @keith for getting back. But if you see my TestApp, i dont have any dependency CardIO |
You have the dependency on it in 2 places though, TestProj (in the podspec) and TestProjFramework (in the Podfile) |
Podfile: target 'TestProjTestApp' do Podspec: s.dependency 'CardIO', '5.5.5' //this is TestProjFramework depeneding on cardio |
i dont have something like: target 'TestProjTestApp' do |
I got temporary solution to this issue. In my framework, i used the Xcode9's “Linking” setting namely Mach-O Type and set it to “Static Library”. This resolves the linker error which we are getting for CardIO when we use it as framework |
@jamehta Hi there. Did you find any solution apart from setting Mach-O type to "Static Library" ? |
General information
Issue description
I have a ios App X which uses my ios Framework Y as dependency.
Framework Y uses CardIO. i have altered the CardIO.podspec to include .m files to make it use as framework in my Frameowork Y.
Compilation is fine but then i get a linker error as shows in attached snapshot.
If i go to framework Y, add all the 3 *.a files in linked binaries and frameworks section of framework Y, which CardIO gives then error goes away.
But now if i use framework Y in ios App X where Y comes as dependency, then i dont know what i should write in my podspec so that my framework Y builds while building app X.
Ideally i would expect that there should be no need to add the 3 *.a files of CardIO in linked framework and binarries. It should just link having CardIO.framework in linked framework and binaries section of build setting.
The text was updated successfully, but these errors were encountered: