You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
target 'App'
pod 'A', :path => 'path/to/local/pod'
pod 'B', :path => 'path/to/local/pod'
Pod::Spec.new do |s|
s.name = 'A'
...
s.dependency 'Lib/ResourceA' # <~ Look here
s.dependency 'Lib/ResourceB' # <~ Look here
end
Pod::Spec.new do |s|
s.name = 'B'
...
s.dependency 'Lib/ResourceB' # <~ Look here
s.dependency 'Lib/ResourceC' # <~ Look here
end
Then pod install will resolve it like so.
pod A depends on Lib
pod B depends on Lib
Lib depends on Lib-ResourceA, Lib-ResourceB, Lib-ResourceC
Everything is fine.
Now lets consider following example:
target 'App'
pod 'A', :path => 'path/to/local/pod'
pod 'B', :path => 'path/to/local/pod'
target 'IndependentTarget' # <~ Added target in the same xcodeproj. But don't link it into App
pod 'A', :path => 'path/to/local/pod' # <~ Depend only on A.
Pod::Spec.new do |s|
s.name = 'A'
...
s.dependency 'Lib/ResourceA' # <~ Look here
s.dependency 'Lib/ResourceB' # <~ Look here
end
Pod::Spec.new do |s|
s.name = 'B'
...
s.dependency 'Lib/ResourceB' # <~ Look here
s.dependency 'Lib/ResourceC' # <~ Look here
end
What happens now?!
cocoa pods resolve dependencies in the following way. Same:
pod B depends on Lib
Lib depends on Lib-ResourceA, Lib-ResourceB, Lib-ResourceC Different:
pod A depends on Lib-ResourceA-ResourceB
Lib-ResourceA-ResourceB depends on Lib-ResourceA-ResourceB-A and Lib-ResourceA-ResourceB-B.
Being that A and B both linked to App target it leads to duplication of artefacts, resource and etc.
What did you expect to happen?
I would say that duplication of target A could be solution.
A-App
A-IndependentTarget
But it may lead to problems when IndependentTarget linked to App.
What happened instead?
Copypaste
pod B depends on Lib
Lib depends on Lib-ResourceA, Lib-ResourceB, Lib-ResourceC Wrong:
pod A depends on Lib-ResourceA-ResourceB
Lib-ResourceA-ResourceB depends on Lib-ResourceA-ResourceB-A and Lib-ResourceA-ResourceB-B.
# Uncomment the next line to define a global platform for your project# platform :ios, '9.0'target'SandUIKit'dopod'MyPod/SubspecThree',:path=>'./pod'pod'MyPod/SubspecTwo',:path=>'./pod'pod'MyPod2',:path=>'./pod'pod'MyPod3',:path=>'./pod'pod'Resource',:path=>'./pod'endtarget'TestThree'dopod'MyPod/SubspecOne',:path=>'./pod'pod'MyPod/SubspecThree',:path=>'./pod'pod'MyPod2',:path=>'./pod'pod'Resource/Regular',:path=>'./pod'pod'Resource/Medium',:path=>'./pod'end
Resolution issue with different set of supspecs.
What did you do?
Hey there!
Encountered pods resolution issue.
Details below:
Consider following
Podfile
and.podspec
s.Then pod install will resolve it like so.
pod A depends on Lib
pod B depends on Lib
Lib depends on Lib-ResourceA, Lib-ResourceB, Lib-ResourceC
Everything is fine.
Now lets consider following example:
What happens now?!
cocoa pods resolve dependencies in the following way.
Same:
pod B depends on Lib
Lib depends on Lib-ResourceA, Lib-ResourceB, Lib-ResourceC
Different:
pod A depends on Lib-ResourceA-ResourceB
Lib-ResourceA-ResourceB depends on Lib-ResourceA-ResourceB-A and Lib-ResourceA-ResourceB-B.
Being that A and B both linked to App target it leads to duplication of artefacts, resource and etc.
What did you expect to happen?
I would say that duplication of target A could be solution.
A-App
A-IndependentTarget
But it may lead to problems when IndependentTarget linked to App.
What happened instead?
Copypaste
pod B depends on Lib
Lib depends on Lib-ResourceA, Lib-ResourceB, Lib-ResourceC
Wrong:
pod A depends on Lib-ResourceA-ResourceB
Lib-ResourceA-ResourceB depends on Lib-ResourceA-ResourceB-A and Lib-ResourceA-ResourceB-B.
CocoaPods Environment
Stack
Plugins
Podfile
Project that demonstrates the issue
demo project
The text was updated successfully, but these errors were encountered: