The issue of installing individual subspecs across different build configurations has been raised in the past: https://github.com/CocoaPods/CocoaPods/issues/3503
Is there a workaround for this issue? Here's a typical scenario:
pod 'MySDK/Core'
pod 'MySDK/Foo_Debug', :configuration => 'Debug'
pod 'MySDK/Foo_Release', :configuration => 'Release'
The best workaround is to define those in root podspecs and not use subspecs.
That's a good idea.
Of course git tags then become an issue... I guess I'll have to work out a prefix for tags like pod-mysdk-core-1.2.3 and pod-mysdk-foo-debug-4.1.2
Actually, the main problem with this workaround is if both subspecs are subdependencies of the main podspec. If you define the subdependencies in root podspecs, you end up with the following:
Pod::Spec.new do |spec|
spec.name = "MySDK"
spec.dependency 'Subdependency_Debug'
spec.dependency 'Subdependency_Release'
This builds successfully, but when running the Debug build configuration I get a runtime error:
dyld: Library not loaded: @rpath/Subdependency_Release.framework/Subdependency_Release
This seems to be a result of my MySDK linking against Subdependency_Debug and Subdependency_Release, and then it unable to find one of them at runtime.
This could be solved with the creation of separate targets. Are there better options?
nope.
Most helpful comment
The best workaround is to define those in root podspecs and not use subspecs.