SDWebImageLottieCoder icon indicating copy to clipboard operation
SDWebImageLottieCoder copied to clipboard

Build error on Xcode 26 / watchOS: 'UITraitCollection' is unavailable

Open tpian928 opened this issue 10 months ago • 1 comments

Hi, after upgrading to Xcode 26, I encountered a build error targeting watchOS:

.../SourcePackages/checkouts/SDWebImage/SDWebImage/Core/SDAnimatedImage.h:80:139: 'UITraitCollection' is unavailable: not available on watchOS

This issue seems to be caused by references to UITraitCollection, which isn't available on watchOS. It builds fine on Xcode 16.4.

Reproduction:

Target platform: watchOS Xcode version: Xcode 26 beta Using Swift Package Manager

Suggestion:

Maybe wrap the relevant code in #if TARGET_OS_IOS || TARGET_OS_TV or similar platform availability checks?

Thanks for the awesome work on this project!

tpian928 avatar Jun 14 '25 08:06 tpian928