Crash on "Library not loaded: /usr/lib/swift/libswiftCloudKit.dylib" in WatchOS 9 and iOS 16 simulators when using CloudKit

I found out that for some reason, /Library/Developer/CoreSimulator/Volumes/watchOS_20R5287q/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 9.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCloudKit.dylib is not a file, but a symlink to /System/Library/Frameworks/CloudKit.framework/CloudKit - which is a folder, not a file, and as a result, any app that uses CloudKit crashes instantly after start on my WatchOS 9 and iOS 16 simulators.

On WatchOS 8.5 and iOS 15.5 sim everything works. Can you confirm if this is a known bug? I tried redownloading the simulators, but the result is same.

Answered by Engineer in 716306022

This is a known issue.

As a workaround, set your minimum deployment target to iOS 16 / tvOS 16 / watchOS 9.

Also filed as FB10058545, but I am hoping that maybe I'm just doing something wrong? I tried adding ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES, that didn't help.

It seems that the problem is that libswiftCloudKit.dylib inside a simulator is wrongly linked (while other *.dylib in a same folder are binaries, not links.)

Accepted Answer

This is a known issue.

As a workaround, set your minimum deployment target to iOS 16 / tvOS 16 / watchOS 9.

Thank you, looking forward to a fix.

Crash on "Library not loaded: /usr/lib/swift/libswiftCloudKit.dylib" in WatchOS 9 and iOS 16 simulators when using CloudKit
 
 
Q