xcode 尝试创建 iOS 应用程序存档时出错:“无法创建配置文件,因为您的团队没有注册设备。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26811551/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:07:38  来源:igfitidea点击:

Error when trying to create archive of iOS app: "Unable to create a provisioning profile because your team has no devices registered."

iosxcodearchiveprofileprovisioning

提问by baltpeter

I am trying to create an archive of an iOS app with Xcode to submit it to the App Store. However, the following error message pops up when I select 'iOS Device' as target and click on Product - Archive:

我正在尝试使用 Xcode 创建 iOS 应用程序的存档以将其提交到 App Store。但是,当我选择“iOS 设备”作为目标并单击“产品 - 存档”时,会弹出以下错误消息:

Unable to create a provisioning profile because your team has no devices registered in the Member Center. Please connect a device, enable it for development, and add it to the Member Center using the Organizer.

无法创建配置文件,因为您的团队没有在会员中心注册的设备。请连接设备,启用它以进行开发,然后使用管理器将其添加到会员中心。

The same error message also appears when I click the "Fix Issue" button on the app settings page where it tells me that there are no provisioning profiles installed.

当我单击应用程序设置页面上的“修复问题”按钮时,也会出现相同的错误消息,它告诉我没有安装配置文件。

There seem to be the following two causes for the issue:

问题似乎有以下两个原因:

  1. The App ID is not registered in the Apple Member Center. I have already fixed this. Unfortunately, it didn't help.
  2. Some older threads mention that you need to add your Mac in the Member Center. However, the instructions given seem to be for older versions of Xcode and don't appear to be working for Xcode 6.1:
    • If I go to Window - Organizer, there is no 'Devices' tab
    • There is Window - Devices though. I do see 'My Mac' here, however I cannot right click and select 'Add to portal' as there is no such option.
    • Under 'Certificates, Identifiers & Profiles' in the Member Center, I cannot add my Mac either. It only seems to accept iOS devices.
  1. App ID 未在 Apple 会员中心注册。我已经解决了这个问题。不幸的是,它没有帮助。
  2. 一些较旧的线程提到您需要在会员中心添加您的 Mac。但是,给出的说明似乎适用于旧版本的 Xcode,似乎不适用于 Xcode 6.1:
    • 如果我转到窗口 - 管理器,则没有“设备”选项卡
    • 虽然有窗口 - 设备。我确实在这里看到了“我的 Mac”,但是我无法右键单击并选择“添加到门户”,因为没有这样的选项。
    • 在会员中心的“证书、标识符和配置文件”下,我也无法添加我的 Mac。它似乎只接受 iOS 设备。

I should also mention that I don't own an iOS device (and unfortunately there is no way for me to buy one either) but according to what I've read, it should be possible to submit an app to the App Store without an iOS device.

我还应该提到我没有 iOS 设备(不幸的是我也没有办法购买)但根据我所读到的内容,应该可以在没有 iOS 设备的情况下向 App Store 提交应用iOS 设备。

Thanks in advance for your assistance!

提前感谢你的帮助!

回答by baltpeter

For those who have the same problem: The issue in my case was that I had multiple certificates configured in the Apple Member Center. Xcode's automatic provisioning only seems to work with one certificate.

对于那些有同样问题的人:我的问题是我在 Apple 会员中心配置了多个证书。Xcode 的自动配置似乎只适用于一个证书。

To solve that problem, you can just manually create a provisioning profile in the Member Center and import that into Xcode. For me, just double clicking the file worked. It didn't show any messages but I was able to use the profile afterwards (it might have also automatically pulled it from the Member Center...).

要解决该问题,您只需在会员中心手动创建配置文件并将其导入 Xcode。对我来说,只需双击文件即可。它没有显示任何消息,但之后我可以使用该配置文件(它也可能会自动从会员中心提取它...)。

To actually use that profile, go into the Build Settings of your app. Under the section 'Code Signing', select the right certificate (the one you used to create the profile) and finally the Provisioning Profile itself. It should look something like that:

要实际使用该配置文件,请进入应用程序的构建设置。在“代码签名”部分下,选择正确的证书(用于创建配置文件的证书),最后选择配置文件本身。它应该看起来像这样:

Setting the right certificate

设置正确的证书

Now, you should be able to archive your app.

现在,您应该能够归档您的应用程序。

Huge thanks to brendan09 and Legolas-the-elf from reddit who helped me solve the issue: https://www.reddit.com/r/iOSProgramming/comments/2lsjpe/error_when_trying_to_create_archive_of_ios_app/

非常感谢 reddit 的 brendan09 和 Legolas-the-elf 帮助我解决了这个问题:https://www.reddit.com/r/iOSProgramming/comments/2lsjpe/error_when_trying_to_create_archive_of_ios_app/