I am using Xcode 12.2, and working on a Swift static framework (embedded in a .xcframework
in the end), which I intend to deliver with CocoaPods.
My issue is currently not the CocoaPods integration in an app project (pod install
works correctly and app builds & run), but the pod validation with pod lib lint
command.
The lint
validation fails, with logs containing the following:
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
ld: warning: Could not find or use auto-linked library 'swiftAVFoundation'
ld: warning: Could not find or use auto-linked library 'swiftAccelerate'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtCs12_SwiftObject", referenced from:
[...]
And log contains the same with
Undefined symbols for architecture arm64
My .podspec
file is the following
Pod::Spec.new do |s|
s.name = 'MyFramework'
s.version = '1.0.0'
s.source = { :git => 'https://url-to-repo.git', :tag => s.version.to_s }
s.ios.deployment_target = '12.0'
s.platform = :ios
s.swift_version = '5.0'
s.requires_arc = true
s.static_framework = true
s.ios.vendored_frameworks = "MyFramework.xcframework"
s.frameworks = 'AVFoundation', 'Accelerate', 'CoreGraphics', 'CoreImage'
s.ios.library = 'z', 'c++'
end
My guess is that the project that CocoaPods creates is with Objective-C, and there would be probably no reference to the Swift compiler or libraries. But I have no clues how to fix this..
I've been losing days on this, any help would be greatly appreciated.
Thanks