SDWebImageWebPCoder icon indicating copy to clipboard operation
SDWebImageWebPCoder copied to clipboard

Carthage build fails when using XCFrameworks flag

Open daltonclaybrook opened this issue 4 years ago • 3 comments
trafficstars

Attempting to build SDWebImageWebPCode with Carthage using the --use-xcframeworks flag results in a build failure. The following error is observed in the log:

...SDImageWebPCoder.h:12:9: fatal error: module 'SDWebImage' not found
@import SDWebImage;
 ~~~~~~~^~~~~~~~~~
1 error generated.

The issue appears to be caused by incomplete FRAMEWORK_SEARCH_PATHS for SDWebImageWebPCoder. Presently, this build setting includes the platform-specific build folder (e.g. $(PROJECT_DIR)/Carthage/Build/iOS) but does not include the root build folder ($(PROJECT_DIR)/Carthage/Build), which is where XCFrameworks are located.

daltonclaybrook avatar May 06 '21 02:05 daltonclaybrook

That #57 merged. I'll release a patch version 0.8.4

However, is this only thing to do that support Carthage with XCFramework ?

I remember the issue talked here: https://github.com/Carthage/Carthage/issues/3019#issuecomment-786350898

Carthage need all the downstream component, to update their Xcode and create a new scheme "Like SDWebImage XCFramework" and add dependency to that.

dreampiggy avatar May 06 '21 08:05 dreampiggy

This is not the case in my experience. For example, SDWebImage and other dependencies build fine as XCFrameworks already.

SDWebImageWebPCoder build console

daltonclaybrook avatar May 06 '21 13:05 daltonclaybrook

Looks great. If Carthage's XCFramework adoptation does not cost too much of maintainess issues, I can update all SDWebImage related components together.

dreampiggy avatar May 07 '21 08:05 dreampiggy