简体   繁体   English

将 HealthKit 添加到 Apple Watch 扩展后应用程序标识符发生冲突

[英]Conflicting app identifiers after adding HealthKit to Apple Watch Extension

I was adding a watchOS target to my already existing iOS target.我正在将 watchOS 目标添加到我现有的 iOS 目标中。 Everything worked fine until I added the HealthKit capabilities in the "Signing & Capability" Section of the watchapp.extension.一切正常,直到我在 watchapp.extension 的“签名和功能”部分添加了 HealthKit 功能。 Whereas everything worked fine with the iOS target, the watchapp extension complained after I added the respective capability and I received 3 errors.虽然在 iOS 目标上一切正常,但在我添加了相应的功能后,watchapp 扩展程序抱怨并收到了 3 个错误。 From which the first stated:其中第一个说:

"Failed to register bundle identifier. The app identifier "[...].watchkitapp.watchkitextension" cannot be registered to your development team. Change your bundle identifier to a unique string to try again." “无法注册包标识符。应用标识符“[...].watchkitapp.watchkitextension”无法注册到您的开发团队。将您的包标识符更改为唯一字符串以重试。”

After adding the capability without details添加没有细节的能力后

After adding the capability with details添加带有详细信息的功能后

Things I tried so far and noticed are listed below:到目前为止我尝试过并注意到的事情如下:

  • the Xcode managed ("automatically signed") Provisioning Profile of the watchkitapp.watchkitextension lags one day behind the Provisioning Profile from the iOS target. watchkitapp.watchkittextension 的 Xcode 管理(“自动签名”)配置文件落后于 iOS 目标的配置文件一天。 Whereas this one misses the capability and 2 entitlements, the latter is up to date.虽然这个错过了能力和 2 项权利,但后者是最新的。 This is also stated by the two other errors:另外两个错误也说明了这一点:

"Provisioning profile "iOS Team Provisioning Profile: *" doesn't support the HealthKit capability." “配置文件“iOS 团队配置文件:*”不支持 HealthKit 功能。”

"Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the com.apple.developer.healthkit and com.apple.developer.healthkit.access entitlements." “配置文件“iOS 团队配置文件:*”不包括 com.apple.developer.healthkit 和 com.apple.developer.healthkit.access 权利。”

  • In the Apple Developer account I can find the iOS identifier and the watchapp identifier.在 Apple Developer 帐户中,我可以找到 iOS 标识符和 watchapp 标识符。 However, the watchkitapp.watchkitextension identifier is missing and cannot be added manuelly, as it is already taken, thus not unique.但是, watchkitapp.watchkittextension 标识符丢失并且无法手动添加,因为它已经被占用,因此不是唯一的。 I don't know how though.我不知道如何。

  • Downloading the provisioning profiles manuelly did not do the job.手动下载配置文件并没有完成这项工作。

  • Removing and adding the watchapp target to the project did reproduce the same error.删除 watchapp 目标并将其添加到项目中确实重现了相同的错误。

  • The app is already running in the Store, so changing the identifier/bundle Id is not an option.该应用程序已在商店中运行,因此无法更改标识符/捆绑包 ID。

  • When I remove the healthKit capability, everything works fine.当我删除 healthKit 功能时,一切正常。 I can run it on my devices and even upload it to the store.我可以在我的设备上运行它,甚至将它上传到商店。

My literal guess is that the provisioning profile for the watchapp.extension is the root cause and that it is somehow attached to another team - which I don't know why.我的字面猜测是 watchapp.extension 的配置文件是根本原因,并且它以某种方式附加到另一个团队 - 我不知道为什么。 It lags one day behind the one for the iOS target and hasn't received the updated about the healthkit.它比 iOS 目标落后一天,并且没有收到有关 healthkit 的更新。 The certificate in the provisioning profile is the same though as in the one concerning the iOS target.配置文件中的证书与有关 iOS 目标的证书相同。 However, even starting from zero and readding the watchapp target did not help.然而,即使从零开始读取 watchapp 目标也无济于事。

The watch app extension was registered with my free plan account under the same identifier and caused the conflict.手表应用程序扩展程序在我的免费计划帐户下以相同的标识符注册并导致了冲突。 Apple had to delete that identifier in order for it to be assigned to my 'real' developer account. Apple 必须删除该标识符才能将其分配给我的“真实”开发者帐户。

Somehow I managed to register my watch app extension with the same initial bundle identifier as my parent app.不知何故,我设法使用与父应用程序相同的初始包标识符注册了我的手表应用程序扩展。 However, rather than registering it with my real developer account I did so with my free plan account, hence the "Failed to register bundle identifier."但是,我没有使用我的真实开发者帐户注册它,而是使用我的免费计划帐户注册,因此“无法注册捆绑标识符”。 error.错误。

Surprisingly my watch app (not the extension) was registered under my real account which bugs me, since they are both created at the same time when you create the watchOS target.令人惊讶的是,我的手表应用程序(不是扩展程序)是在我的真实帐户下注册的,这让我很烦恼,因为它们都是在您创建 watchOS 目标时同时创建的。

The problem with that is, that as a free user you cannot look into the identifier registered under your account.问题在于,作为免费用户,您无法查看在您帐户下注册的标识符。 You have to ask Apple to delete the identifiers for you.您必须要求 Apple 为您删除标识符。 After that Xcode was creating a new provisioning profile.之后 Xcode 创建一个新的配置文件。

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

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