简体   繁体   English

iOS WatchKit - 应用上传期间 WatchKit 扩展的应用 ID 要求发生冲突

[英]iOS WatchKit - Conflicting App ID requirements for WatchKit Extension during app upload

I decided to support both WatchOS 1 and WatchOS 2. Initially, my bundle IDs for the watch targets are created as follows:我决定同时支持 WatchOS 1 和 WatchOS 2。最初,我为监视目标创建的包 ID 如下所示:

WatchKit App: com.company.myapp.watchkitapp WatchKit 应用程序: com.company.myapp.watchkitapp

WatchKit Extension: com.company.myapp.watchkitextension WatchKit 扩展: com.company.myapp.watchkitextension

With this setup, build fails with the following error message:使用此设置,构建失败并显示以下错误消息: 在此处输入图片说明

So I changed the bundle IDs to the following format, so that extension's bundle ID is prefixed with watchkit app's bundle ID:所以我将捆绑 ID 更改为以下格式,以便扩展的捆绑 ID 以 watchkit 应用程序的捆绑 ID 为前缀:

WatchKit App: com.company.myapp.watchkitapp WatchKit 应用程序: com.company.myapp.watchkitapp

WatchKit Extension: com.company.myapp.watchkitapp.watchkitextension WatchKit 扩展: com.company.myapp.watchkitapp.watchkitextension

Build succeeds.构建成功。 I then try to upload the build to Testflight in preparation for the release, but during the upload process I got the following error:然后我尝试将构建上传到 Testflight 以准备发布,但在上传过程中我收到以下错误: 在此处输入图片说明

The error message is clear: I have two periods after the application's bundle ID.错误消息很明确:我在应用程序的包 ID 后面有两个句点。

This is very confusing to me.这让我很困惑。 How is it possible that the bundle ID of my extension should be prefixed with watchkit app's bundle ID, and contain only one period after the parent app's bundle ID?我的扩展程序包 ID 怎么可能以 watchkit 应用程序包 ID 为前缀,并且在父应用程序包 ID 之后只包含一个句点? The prefix will already have used that one period.前缀将已经使用了那个时期。 How can I satisfy these two conflicting requirements at the same time?我怎样才能同时满足这两个相互冲突的要求?

Things I have already tried but not working:我已经尝试过但不起作用的事情:

  1. Starting from scratch, creating brand new app ids and provisioning profiles;从头开始,创建全新的应用程序 ID 和配置文件; Deleting all old provisioning profiles from local, re-downloading, then setting the correct code signing and provisioning profiles in target Build Settings in Xcode.从本地删除所有旧的配置文件,重新下载,然后在 Xcode 的目标构建设置中设置正确的代码签名和配置文件。

  2. Changing the name of the App ID to match the format of "XC com company myapp", in Member Center.在会员中心更改App ID的名称以匹配“XC com company myapp”的格式。

  3. Quit & restart & clean & rebuild.退出 & 重新启动 & 清理 & 重建。

opening Xcode Preferences ( + , ), going to Accounts → View Details.打开 Xcode Preferences ( + , ),转到 Accounts → View Details。 Then select all provisioning profiles and delete them with backspace (note: they can't be removed in Xcode 7.x).然后选择所有配置文件并用退格键删除它们(注意:它们不能在 Xcode 7.x 中删除)。 Restart Xcode, else the list doesn't seem to update properly.重新启动 Xcode,否则列表似乎无法正确更新。

Now click the Download all button, and you should have all provisioning profiles that you defined in the Member center back in Xcode.现在单击“全部下载”按钮,您应该拥有您在会员中心定义的所有配置文件回到 Xcode。 Don't worry about the Xcode-generated ones (Prefixed with XC:), Xcode will regenerate them if necessary.不要担心 Xcode 生成的(前缀为 XC:),如果需要,Xcode 会重新生成它们。 Restart Xcode again.再次重启Xcode。

Now go to the Code Signing section in your Build Settings and select the correct profile and cert.现在转到构建设置中的代码签名部分,然后选择正确的配置文件和证书。

for more 更多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM