Closed jackywpy closed 1 year ago
What build system did you use ? For example, when use SwiftPM and integrated Xcode support, you may need to add both SDWebImage
and SDWebImageSwiftUI
into Link Library and Frameworks
of project build phase.
@dreampiggy
encountered same issue here.
I used CocoaPods
+ Static
setting like this.
build using Xcode 14.3
Podfile
platform :ios, '14.0'
target 'some-target-name' do
# use_frameworks!
pod 'SDWebImage', '5.12.1', :modular_headers => true
pod 'SDWebImageSwiftUI', '2.2.2'
end
I also have same issue here,how to solve it. build using Xcode 14.3
same here !
Will fix in later. These months have no time in iOS development, focus on LLVM/Swift toolchain.
(Workaround, CocoaPods + Xcode 14.3)
Setting Project: Pods > Targets: SDWebImageSwiftUI > Build Settings > Build Libraries for Distribution
to "No" and I was able to build the app.
Is this the same issue as #261 ? See comments there
@niccari Oh. You're using CocoaPods with Library Evolution on. The SPM does not enable Library Evolution, maybe this cause problem.
And, what cause CocoaPods use Library Evolution on ? I try that :modular_headers => true
it does not enable this by default.
@Willicious-k @higekick @Niccari Seems because of that Static Lib + Library Evolution YES
cause the issue
Can you use the Static Framework
integration to test ?
use_frameworks! :linkage => :static
Seems because of that Static Lib + Library Evolution YES cause the issue
Agreed, I'm using Static Framework(not setting use_frameworks!
) and Library Evolution YES in the project.
in Pods/Pods.xcodeproj/project.pbxproj
, there was no "BUILD_LIBRARY_FOR_DISTRIBUTION" key and somehow "YES" used as defaults in the SDWebImageSwiftUI only so I'll investigate why it happens.
Checked below situations.
no such module 'SDWebImage'
has been raiseduse_frameworks! :linkage => :static
) + BUILD_LIBRARY_FOR_DISTRIBUTION = Yesuse_frameworks!
) + BUILD_LIBRARY_FOR_DISTRIBUTION = Yes@dreampiggy
And, what cause CocoaPods use Library Evolution on ? I try that :modular_headers => true it does not enable this by default.
In SDWebImageSwiftUI.podspec, it seems that swift interface needs to be generated and BUILD_LIBRARY_FOR_DISTRIBUTION is set to "yes". https://github.com/SDWebImage/SDWebImageSwiftUI/commit/056cc697131cc71946cd0b4bf25628e4cc43d25a
Thanks! @Niccari
Seems that Podspec
hack for BUILD_LIBRARY_FOR_DISTRIBUTION
should be removed. I doubt what issue cause me to add this at that time (Xcode 12, 2 years agao....)
But seems this is the correcy way to go, since whether or not to enable Library Evolution
is controlled by user who integrate, not the lib author
I have a compiler error when using xCode 14.3, swift 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)):
failed to verify module interface of 'SDWebImageSwiftUI' due to the errors above; the textual interface may be broken by project issues or a compiler bug.
thanks