xcode iCloud 设置和配置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24222524/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iCloud set up and provisioning
提问by RichAppz
I am trying to set up iCloud within my iOS application, I have done the following:
我正在尝试在我的 iOS 应用程序中设置 iCloud,我已完成以下操作:
- Removed all old certs on mac.
- Added iCloud to the App in Dev Console - created new container and added to app
- Redone the dev provision and downloaded
- Installed the provision
- Added the iCloud Entitlement to the app
- 删除了 mac 上的所有旧证书。
- 将 iCloud 添加到开发控制台中的应用程序 - 创建新容器并添加到应用程序
- 重做开发配置并下载
- 安装了规定
- 向应用程序添加了 iCloud 权利
And this is where is all goes wrong...
这就是一切都出错的地方......
I can't get the app running again, the app is building but I am getting an error saying:
我无法再次运行该应用程序,该应用程序正在构建,但我收到一条错误消息:
The entitlements specified in your application's Code Signing Entitlements file do not match those specified in your provisioning profile.
在您的应用程序的代码签名权利文件中指定的权利与在您的配置文件中指定的权利不匹配。
(0xE8008016).
(0xE8008016)。
Any ideas??
有任何想法吗??
UPDATE: I have managed to be able to run the application to get everything programmed and put in place, everything is set up iTunes Connect end, all provisions are valid and sync'd.
更新:我已经设法运行该应用程序,使所有内容都已编程并就位,一切都已设置到 iTunes Connect 端,所有规定均有效且已同步。
Now I am getting errors during validation...
现在我在验证过程中遇到错误...
There are 4: Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported by iOS. Specifically, key 'com.apple.developer.icloud-container-identifiers' in Payload ------- not supported
有 4 个:无效的代码签名权利。您的应用程序包的签名包含 iOS 不支持的代码签名权利。具体来说,有效载荷中的关键 'com.apple.developer.icloud-container-identifiers' ------- 不支持
Other 3 are similar for other containers!
其他 3 个与其他容器类似!
采纳答案by RichAppz
After submitting a report to Apple, it turns out that Apple systems are useless AGAIN!
向苹果提交报告后,结果发现苹果系统又没用了!
Ok, so if you are creating a NEW application or you are only just adding iCloud to your application - you will need to make sure the system doesn't pick up or create a iOS8 cloud container!
好的,所以如果您正在创建一个新的应用程序或者您只是将 iCloud 添加到您的应用程序 - 您需要确保系统不会选择或创建一个 iOS8 云容器!
If it does you need to remove it from your app entitlements file, remove the selected containers in the Apple Developer Console and re-download certs again!
如果确实需要将其从应用程序权利文件中删除,请在 Apple Developer Console 中删除选定的容器并再次重新下载证书!
Thanks Apple again!
再次感谢苹果!
I got blamed for using pre-released software! I haven't touch Xcode 6 yet!!!
我因使用预发布的软件而受到指责!我还没有接触 Xcode 6 !!!
回答by Jonathan Ma
Maybe it's a late comment, but I post it here in case that somebody is struggling for the same reason.
也许这是一个迟到的评论,但我把它贴在这里,以防有人因为同样的原因而苦苦挣扎。
I encountered this issue on Xcode8 recently when I was trying to archive. Generally, I enabled iCloud with Xcode in following steps:
我最近在尝试存档时在 Xcode8 上遇到了这个问题。通常,我通过以下步骤使用 Xcode 启用 iCloud:
- Enable iCloud in
Capabilities
panel in my target by setting the toggle to ON. - Check
iCloud
under my App Identifier in Member Center turns green automatically, and a iCloud container is created automatically with my App Identifier. (Apple's system does this for us.) - Regenerate my certificate with my App Identifier.
- Create a new provisioning profile.
- Download and install the new certificate and provisioning profile
- Select the new provisioning profile in
Signing(Release)
section inGeneral
panel in my target.
Capabilities
通过将切换开关设置为 ON,在我的目标中的面板中启用 iCloud 。iCloud
会员中心中我的应用标识符下的检查会自动变为绿色,并且会使用我的应用标识符自动创建一个 iCloud 容器。(Apple 的系统为我们做这件事。)- 使用我的应用程序标识符重新生成我的证书。
- 创建一个新的配置文件。
- 下载并安装新的证书和配置文件
- 在我的目标面板的
Signing(Release)
部分中选择新的配置文件General
。
Then I got errors like:
然后我得到了如下错误:
Provisioning profile "iCloud Test" doesn't include the com.apple.developer.ubiquity-container-identifiers, com.apple.developer.icloud-container-identifiers, and com.apple.developer.icloud-services entitlements. Code signing is required for product type 'Application' in SDK 'iOS 10.1' Code signing is required for product type 'Application' in SDK 'iOS 10.1'
配置文件“iCloud 测试”不包括 com.apple.developer.ubiquity-container-identifiers、com.apple.developer.icloud-container-identifiers 和 com.apple.developer.icloud-services 权利。SDK“iOS 10.1”中的产品类型“应用程序”需要代码签名 SDK“iOS 10.1”中的产品类型“应用程序”需要代码签名
At last I found that there were two options in iCloud section under my App Identifier in Member Center. By default, the Compatible with Xcode 5
was selected, but I succeeded by selecting the other option.
最后我发现在会员中心我的应用程序标识符下的 iCloud 部分有两个选项。默认情况下,Compatible with Xcode 5
选择了 ,但我通过选择其他选项成功了。
回答by Nick
If you're just adding iCloud to an app for the first time or want to upgrade to use CloudKit after using an older iCloud container:
如果您只是第一次将 iCloud 添加到应用程序,或者想在使用旧的 iCloud 容器后升级以使用 CloudKit:
- Go to the Apple Development Center.
- Choose Certificates, IDs & Profiles.
- Use the dropdown on the top left to switch between iOS/tvOS/watchOS or macOS
- Choose App IDsunder the Identifierssection.
- Choose your app from the list.
- Scroll down to iCloudand make sure it is enabled with a green dot.
- If it's not enabled or has a yellow dot, click the button at the bottom of the page to Editand make sure you've checked iCloud service.
- You may also need to create a container under the iCloud Containerssection then associate it with this app.
- 前往Apple 开发中心。
- 选择证书、ID 和配置文件。
- 使用左上角的下拉菜单在 iOS/tvOS/watchOS 或 macOS 之间切换
- 在标识符部分下选择应用程序 ID。
- 从列表中选择您的应用。
- 向下滚动到iCloud并确保它已启用绿点。
- 如果未启用或有黄点,请单击页面底部的按钮进行编辑并确保您已选中 iCloud 服务。
- 您可能还需要在iCloud Containers部分下创建一个容器,然后将其与此应用程序相关联。
回答by Dario Caric
What I did: - leave only com.apple.developer.icloud-services in entitlements file - in Capabilities under iCloud marked key value storage and iCloud Documents (cloud kit EMPTY) - Containers set to specify custom but do not select any of your containers - This will probably give you RED warning sign under steps but leave it as it is DO NOT FIX - Regarding provisioning profile Development and Distribution profiles have to have App ID which has iCloud enabled but NOT linked to any container - In those provisioning profiles set under iCloud OLD version for Xcode 5 etc. not a new one related to iCloud containers
我所做的: - 在权利文件中只留下 com.apple.developer.icloud-services - 在 iCloud 标记键值存储和 iCloud 文档(云套件 EMPTY)下的功能 - 容器设置为指定自定义但不选择任何容器- 这可能会在步骤下为您提供红色警告标志,但保持不变 - 关于配置文件开发和分发配置文件必须具有启用了 iCloud 但未链接到任何容器的 App ID - 在那些配置文件中设置用于 Xcode 5 等的 iCloud 旧版本,不是与 iCloud 容器相关的新版本
回答by Omega
I had an error of "Add iCloud Containers to your App ID".
我遇到了“将 iCloud 容器添加到您的 App ID”的错误。
Automatic signing was unable to resolve an issue with target's entitlements.
自动签名无法解决目标权利的问题。
I don't even use iCloud Containers, only Key-value storage(keychain). I also switched in iCloud section under my App Identifier in Member Center from "Compatible with Xcode 5" to "Include CloudKit support (requires Xcode 6)" problem still remains.
我什至不使用 iCloud 容器,只使用键值存储(钥匙串)。我还在会员中心的应用程序标识符下的 iCloud 部分从“与 Xcode 5 兼容”切换到“包括 CloudKit 支持(需要 Xcode 6)”问题仍然存在。
So I fixed it like this:
所以我把它修成这样:
- Enable iCloud Capabilities panel in my target by setting the toggle to ON.
- Turn on "Include CloudKit support (requires Xcode 6)" in Member Center (still got same error).
- in Xcode in iCloud Capabilities TURN ON CloudKit (even if you don't need it) and then turn OFF.
- 通过将切换开关设置为 ON,在我的目标中启用 iCloud 功能面板。
- 在会员中心打开“包括 CloudKit 支持(需要 Xcode 6)”(仍然有同样的错误)。
- 在 iCloud 功能中的 Xcode 中打开 CloudKit(即使您不需要它)然后关闭。
And then problem solved for me!
然后问题为我解决了!