SwiftData+Cloudkit and records with CKAsset import on fresh install never ends.

I’m using SwiftData with CloudKit and running into an issue during initial sync on a fresh device. I’m importing a small set of records, some records has images as CKAsset (with about 5 images ~3MB). Records indexes are the default ones for the Dev env.

The problem is that the import process never seems to complete. However, if I delete those records that contains the assets from the iCloud Dashboard, the import finishes successfully.

Has anyone experienced something similar? What approach would you recommend to handle this without implementing a custom sync layer on top of CloudKit?

I am logging remote changes events (NSPersistentStoreRemoteChange): CloudKit import in progress...|2026-04-25 22:18:10|

Then I see: Background Task 49 ("CoreData: CloudKit Import"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

And then the import never ends.

Thanks!

The message you provided is a benign warning, and isn't directly related to the issue, because NSPersistentCloudKitContainer, which SwiftData + CloudKit uses under the hood, will retry later if an import fails. Also, your app is not terminated.

If your device is not yet on 26.4.1 or better, I'd suggest that you give it a try. If the issue is still there with the latest OS version, I'd suggest that you try with the debug process described in TN3163 to see if you can find any relevant CloudKit error from a sysdiagnose.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

SwiftData+Cloudkit and records with CKAsset import on fresh install never ends.
 
 
Q