0

I have integrated my own two frameworks in project, which uses common static library in both framework. When i run Project it throws below error for static library classes (which is common in both frameworks) -

objc[64586]: Class ABC is implemented in both /Users/user/Library/Developer/Xcode/DerivedData/Project-hjicsdlhsejzcqbhbqvjpzsdpbem/Build/Products/Debug-iphonesimulator/SDK1.framework/SDK1 (0x1056c7220) and /Users/user/Library/Developer/Xcode/DerivedData/Project-hjicsdlhsejzcqbhbqvjpzsdpbem/Build/Products/Debug-iphonesimulator/SDK2.framework/SDK2 (0x102074be0). One of the two will be used. Which one is undefined.

When i run app, only one framework is work and other does not.

Thanks in advance !

Abhijeet Barge
  • 562
  • 5
  • 21
  • Originally I closed this as a dupe of https://stackoverflow.com/questions/10385331/why-dont-ios-framework-dependencies-need-to-be-explicitly-linked-to-a-static-li/10385392#10385392, but I'd like to talk to you about it first. Generally, you don't do this; it doesn't work. You link the static library once at the app layer rather than at each framework layer. If you're trapped (i.e. you cannot redesign the libraries), there are ways to do it, but they are a pain to manage and fragile, and can cause subtle problems depending on the code. – Rob Napier Jan 05 '22 at 22:20
  • If you cannot work around this by redesigning your libraries correctly (i.e. not to have a static library that multiple things link; never do that), then start by looking over https://orangejuiceliberationfront.com/hiding-symbols-in-static-libraries-with-xcode-or-cmake/ You can control the visibility of symbols and hide the static library symbols. But it means understanding and configuring a lot more of how the linking is done. – Rob Napier Jan 05 '22 at 22:22
  • For the official docs, see https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html#//apple_ref/doc/uid/TP40001670 (These examples are all in C. Dealing with the differences between Swift and C is part of the challenge. I don't recommend this unless you're backed into a corner.) – Rob Napier Jan 05 '22 at 22:24

0 Answers0