Reputation: 616
In my iOS XCode project I'm using an external, non open source library from a third party. Now I want to add AFNetworking to my Project via cocoapods. When I do so, I get multiple of errors like this one:
duplicate symbol _OBJC_METACLASS_$_AFImageCache in:
/Path/to/framework(UIImageView+AFNetworking.o)
/Path/to/DerivedData/Build/Products/Debug-iphonesimulator/libPods.a(UIImageView+AFNetworking.o)
63 duplicate symbols for architecture i386
It seams that the library is also using AFNetworking and by that is preventing me to use it. Is there any way to solve this (apart from not using the other framework, which is not an option)?
Edit
I managed to remove AFNetworking from the other framework by doing something similar to this. But now the framework doesn't find AFNetworking from cocoapods and I get Undefined symbols for architecture i386
.
Is there a way to tell the framework where to find AFNetworking?
Upvotes: 4
Views: 1554
Reputation: 63914
You cannot load the same library from two different places in the same project. This is a limitation of Objective-C, not CocoaPods. Read this answer for more details.
Mainly to fix this you can only include AFNetworking in one place. Moving your other dependencies to CocoaPods could help you do this, assuming there are no conflicts in the versions as discussed in the linked answer.
Upvotes: 2