Search code examples
iosswiftobjective-ccocoapods

Pod Dependency conflicting names


I develop two frameworks (Framework A and Framework B) and deliver them via Cocoapods.Framework A has a dependency on Framework B . Below you can see the pod spec for a Framework A:

s.ios.dependency 'Framework B/Dynamic', "~> 1.0.0"

If I install both frameworks via CocoaPods and specify them both in the Podifle , I receive an error:

[!] The 'PodsTarget' target has frameworks with conflicting names: framework_b_name.xcframework.

I wonder, is there any .podspec argument or build settings for Framework A , which could help me to solve this issue. For example, cocoapods will not install additional Framework A in case, if both Framework A and B have been specified in the Podfile ? I want this issue to be solved on the dependency side and not on the side of the client (person, who installs the pod).

I have tried to use weak linking flag in the build settings as well, as removing /Dynamic from the .podspec


Solution

  • So, here is my solution for the current problem:

    In Podfile I have my FrameworkB (without specific version it pulls the latest major, let's say 2.0.0). In my Podspec I had version of a dependency set to ~> 1.0.0], which will pull any version, that is higher, than 1.0.0, but lower than 2.0.0. Plus, I pulled FrameworkB/Dynamic, which led to creation of Dynamic folder, so after pod install/update, I had following project struct:

    project
    │   /..../    
    │
    └───Pods
    │   │   FrameworkB.framework
    │   │
    │   └───Dynamic
    │          FrameworkB.framework
    

    Changing version in the .podspec file to >=1.0.0 fixed the problem.