I'm developing a framework which will be distributed via CocoaPods as .xcframework. The framework is depending on some third party libraries and using CocoaPods to resolve that dependencies. To support the module stability feature in my framework I set BUILD_LIBRARY_FOR_DISTRUBUTION option to YES in build settings of the framework project.
I know that if my module-stable framework using some dependencies I should set BUILD_LIBRARY_FOR_DISTRUBUTION=YES setting for each dependency used by the framework. I achieving this by adding post install script to Podfile in app where the framework is integrated. This script looks like this:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
end
end
If I open some project that integrates my .xcframework via CocoaPods in Xcode with the same version that was used for the framework building (Xcode 12.5 in my case), everything will be fine on build and run. But if I try to build and run this project in Xcode with some other version (I tested it with Xcode 12.4), launched app will crash on startup with "dyld: Symbol not found..." error.
How to achieve true module stability for my framework even if it has some dependencies? And, if it possible, how to avoid forcing our clients to add post install script to their podfiles?