问题描述
群友反馈Xcode中Watch项目的Signing & Capabilities -> Signing 显示如下报错。
报错信息1:
Communication with Apple failed
Your account does not have sufficient permissionsto modify containers.
Provisioning profile "iOs Team Provisioning
Profile:
com...watchkitapp" doesn't support theiCloud...CompassWatchiCloud Container.
Provisioning profile "iOs Team Provisioning
Profile:
com...watchkitapp" doesn't match the entitlements file's valuefor the com.apple.developer.icloud-container
identifiers entitlement.

报错信息2:
Doesn't match entitlements file value forcom.apple.developer.icloud-container-identifiers.

我让群友检查是否是Watch项目没有配置iCloud容器。

他表示Xcode的Watch项目已经配置iCloud容器。
然后我检查这个问题,发现之前我的App Group(《SwiftUI UserDefaults使用App Group共享数据》)也存在过类似的报错。

App Group报错的解决方案为:
1、检查Xcode → 选中主项目 → 目标(Targets)→ Signing & Capabilities,是否配置App Group。
2、前往Apple Developer – Certificates, Identifiers & Profiles,在Identifiers模块中,找到对应的App,检查“App Groups” 部分是否勾选。
因为,与本次Xcode报错类似,都是在Xcode项目内的“Signing & Capabilities”页面显示报错。因此,我也让群友检查这两个地方。
最后,群友检查发现Identifiers中的iCloud未配置对应容器导致的报错。

扩展知识
配置Identifiers
首先,前往Apple Developer – Certificates, Identifiers & Profiles,在Identifiers中找到对应的App。

找到iCloud配置项,点击“Edit”按钮。

勾选对应的iCloud容器,点击“Continue”按钮,完成配置。

相关文章
Xcode 13 Beta 3 failing to setup iCloud container (provisioning profile):https://developer.apple.com/forums/thread/685262