-
Notifications
You must be signed in to change notification settings - Fork 281
Addind a Third-Party Framework to the iOS-Framework #83
Comments
See: #67 It is a bit funny, this is what I want to do with my SDK. I don't want the External frameworks hard linked to my framework product. Unfortunately I can't figure it out as I'm using both iOS-Framework and various Cocoapod frameworks, every time I build it is including the entire libPods.a. Thus when I shove my framework into a dependent project I get to see the glorious duplicate symbols for AFNetworking and such. @loretoparisi In your case this is the intended functionality of frameworks, if you are dependent upon other frameworks, for example CoreData.framework you simply have to make sure that the documentation for the framework you are designing includes a blurb for saying "Hey you need to include CoreData.framework in order for this to function", there are compiler warning flags you can set as well to warn the users of your framework that something is wrong. |
Thanks. I can add that it's ok when you are including Apple's .framework packages, but in my case I have more than own frameworks from the same company (for different reasons) and I would like to pack them all together: By example I would like to have a structure like that:
So it's easy to include all Apple's framework or ask other developers to include them. But in my case I have other frameworks (proprietary frameworks) that I cannot share to external developers. I can only bundle in my static library, wrap them and distribute them in my static bundled library framework. |
I need to accomplish the same task. Is this resolved? |
@gtasko Follow this article. "Avoiding Dependency Collision". http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/ |
@kodeshpa Thanks, will read it in a moment. Also I followed to the #67 issue which is what I want to make and the conclusion is to use the libtool command tool to embed the framework. libtool -static -o "${SRCROOT}/Products/YOURProject.framework/Versions/A/YOURProject" "${SRCROOT}/Products/YOURProject.framework/Versions/A/YOURProject" "${SRCROOT}/AFolder/ThirdParty.framework/Versions/A/ThirdParty" The above should work, need to test it though. I understand all the problems I introduce but it is what I've asked to. I also disagree in the process, but in the end it is a good practice and learning about all the libraries/frameworks internals. Thank you for your answer. |
@gtasko So using the |
@loretoparisi Yes, I have tested it and it works fine for me. |
@kodeshpa The tutorial needs some more specifications. Like we need to add in both the static libraries targets (project and ext) the compile source, if we don't then the ext compile sources are not just copied to the resulting .a with only adding it as dependency. I followed all the instructions and nm -a libext.a or libMyLibrary.a has the AFNetworking (I test with) still with the AF prefix, I suppose it should be ABCAF****, right? |
OK, now I've made some improvement. I get the following in a test client that I also added AFNetworking as my static library which I generated .framework and linked to the client. Undefined symbols for architecture i386: See the SLK prefix is what I set in the run script. But it seems that it can't find the symbols in the .framework. Also I should mention that I had to add the AFNetworking classes to both static libraries target so it can be included in the main library target binary, or else it wasn't. Any idea why I have the above issue with linking? |
@GSatko Can you please explain how to use this script and where. |
Supposed to add a 3rd-Party framework the iOS-Framework, how to export this in the generated framework?
Let's say the Serenity framework project has a External.framework. As soon as I build the Serenity.framework linking the External.framework ( I added this .framework to the "Link Binary With Libraries") and add it to the Third Party example app, I have got an error:
Undefined symbols for architecture i386:
"OBJC_CLASS$_SBNotificationHub", referenced from:
objc-class-ref in Serenity(Widget.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
that is the object defined in the static framework External.framework I'm linking by the Serenity.framework in the ThirdParty app.
So far I have to import again the External.framework inside the ThirdParty project to make it work properly.
The text was updated successfully, but these errors were encountered: