I am working with a framework from a private vendor through CocoaPods. The framework is targeted as iOS 12 but one of its dependencies (SwiftDate) is actually targeted for iOS 13, which raised the following error in Xcode: Compiling for iOS 12.0, but module 'SwiftDate' has a minimum deployment target of iOS 13.0
To fix that I did what @ababykina suggested and applied iOS 13 to all pods in post_install
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
By doing so I got the crash mentioned in the original post:
dyld[30013]: Symbol not found: __ZN5swift34swift50override_conformsToProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEPFPKNS_18TargetWitnessTableIS1_EES4_S8_E
Referenced from: [...]/TestSDK.app/Frameworks/TheVendor.framework/TheVendor
Expected in: [...]/TestSDK.app/Frameworks/Alamofire.framework/Alamofire
The error mentioned the issue at hand: Alamofire was missing in my case.
From what I understand when you force a IPHONEOS_DEPLOYMENT_TARGET to a higher value than actually supported you'll see no error, yet it will not be included in the app afterwards and causes this crash. And indeed the vendor's podspec mentioned Alamofire 5.5.0 which targets iOS 10, and not 13 or up.
To fix this I had to isolate the offending dependency in post_install
and execute pod install
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'SwiftDate'
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
And now it runs properly.
Hope this helps.