Cloudkit + Watch - Invalid bundle ID for container

I'm running into a problem getting CloudKit to work with a watch app I'm adding to my existing iOS app. I've created a new target for a watch app, and on boot on my real watch, I'm getting the following error:

com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x14e455f0: "Permission Failure" (10/2007); server message = "Invalid bundle ID for container"

My iOS app has the bundle ID of stevenquinn.POS-Chickens and my watch app is stevenquinn.POS-Chickens.watchkitapp. I'm using NSPersistentCloudKitContainer in a shared Persistence file that's accessible by both targets. Both targets have the same iCloud capabilities and containers checked. Any tips on where I might be running wrong?

Replies

You must specify the bundle ID as the container identifier when instantiating your CKContainer.