Xcode 14中乘法应用程序的权利

发布于 2025-02-13 16:26:29 字数 1003 浏览 0 评论 0原文

在Xcode 14之前创建乘法应用程序时,Xcode将为每个目标创建一个单独的权利文件。现在,使用Xcode 14,所有目标默认情况下使用相同的权利文件。

将HealthKit功能添加到Xcode 14项目并填充“隐私 - 健康更新用法描述”键> info.plist中的键,然后提示HealthKit授权请求,屏幕要求用户使用HealthKit数据同意该应用程序。此外,在控制台中打印了以下错误:健康请求显示失败:缺少应用程序识别符。

为了解决此问题,我手动编辑了“权利文件”文件,以使其看起来像这样:

将应用程序识别符授权添加到权利文件中,手动解决该问题,但是由于MacOS目标也使用了相同的权利文件,因此Xcode无法自动签署MacOS的应用程序,并给出以下错误:

Provisioning profile "Mac Team Provisioning Profile: com.xx.xx" doesn't include the application-identifier entitlement.

在这里您可以看到签名中给出的错误&功能:

这里的正确方法是什么?我应该手动创建第二个权利文件并将其分开吗?如果是这样,这将如何完成?还是我缺少其他东西?

任何帮助将不胜感激。

When creating a Multiplatform Application prior to Xcode 14, Xcode would create a separate Entitlements-file for each target. Now, with Xcode 14, all targets use the same Entitlements file by default.

After adding the HealthKit capability to an Xcode 14 project and populating the "Privacy - Health Update Usage Description" Key with a string in Info.plist, then prompting a HealthKit authorization request, the screen asking the user to agree to the App using HealthKit data does not pop up. Moreover, the following error is printed in the console: Health request display failed: Missing application-identifier entitlement.

In an effort to fix this problem, I edited the Entitlements file manually to look like this:
Entitlements file

Adding the application-identifier entitlement to the Entitlements file manually fixes the issue, however, as the same Entitlements file is also used by the macOS target, Xcode fails to automatically sign the app for macOS and gives the following error:

Provisioning profile "Mac Team Provisioning Profile: com.xx.xx" doesn't include the application-identifier entitlement.

Here you can see the error given in Signing & Capabilities:
Signing & Capabilities Xcode screen with error message

What is the correct approach here? Should I manually create a second Entitlements file and separate them? If so, how would this be done? Or is there something else I'm missing?

Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍风燃霜 2025-02-20 16:26:29

在实际设备上进行测试,而无需手动编辑权利文件,错误会消失,而HealthKit权限请求将适当显示。
因此,我认为以上行为只是当前Beta中的XCode/Simulator错误。

Testing on a real device, without manually editing the entitlements file, the error disappears and the HealthKit permission request is shown appropriately.
Therefore, I believe the behavior above is just a Xcode/Simulator bug in the current beta.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文