ios 提交时 Xcode 8“应用程序签名中缺少 aps-environment 权利”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39554177/
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
Xcode 8 "the aps-environment entitlement is missing from the app's signature" on submit
提问by Unome
I've got an app that we've submitted dozends of versions to in the last 6 months and we do use APNS. I got the following email from Apple after upgrading to Xcode 8
我有一个应用程序,我们在过去 6 个月内向该应用程序提交了数十个版本,并且我们确实使用了 APNS。升级到 Xcode 8 后,我收到了来自 Apple 的以下电子邮件
Dear developer,
We have discovered one or more issues with your recent delivery for APP_NAME. Your delivery was successful, but you may wish to correct the following issues in your next delivery:
Missing Push Notification Entitlement - Your app includes an API for Apple's Push Notification service, but the aps-environment entitlement is missing from the app's signature. To resolve this, make sure your App ID is enabled for push notification in the Provisioning Portal. Then, sign your app with a distribution provisioning profile that includes the aps-environment entitlement. This will create the correct signature, and you can resubmit your app. See "Provisioning and Development" in the Local and Push Notification Programming Guide for more information. If your app does not use the Apple Push Notification service, no action is required. You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact the developer for information on removing the API.
After you've corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
Regards,
The App Store team
亲爱的开发者,
我们发现您最近为 APP_NAME 交付的一个或多个问题。您的交付成功,但您可能希望在下次交付时更正以下问题:
缺少推送通知权利 - 您的应用程序包含 Apple 推送通知服务的 API,但应用程序签名中缺少 aps-environment 权利。要解决此问题,请确保您的 App ID 在 Provisioning Portal 中启用推送通知。然后,使用包含 aps-environment 权利的分发配置文件对您的应用程序进行签名。这将创建正确的签名,您可以重新提交您的应用程序。有关更多信息,请参阅本地和推送通知编程指南中的“供应和开发”。如果您的应用程序不使用 Apple 推送通知服务,则无需执行任何操作。您可以从以后的提交中删除 API 以停止此警告。如果您使用第三方框架,
更正问题后,您可以使用 Xcode 或 Application Loader 将新的二进制文件上传到 iTunes Connect。
问候,
应用商店团队
What is weird is I went to developer.apple.com-> Certificates, Identifiers & Profilesand my AppId does have Push Notifications enabled still. I'm not doing anything different then I've ever done on it so am curious if the Xcode 8 update broke something. Any ideas?
奇怪的是我去了developer.apple.com-> Certificates, Identifiers & Profiles并且我的 AppId 仍然启用了推送通知。我没有做任何与我做过的事情不同的事情,所以很好奇 Xcode 8 更新是否破坏了某些东西。有任何想法吗?
BTW: The link they put for the Push Notification Programming Guide was broken in the email, so that's not a good sign.
顺便说一句:他们为推送通知编程指南提供的链接在电子邮件中被破坏了,所以这不是一个好兆头。
回答by Unome
Very easy actually. For some reason it got disabled on Xcode 8 but go to Targets -> Capabilities and verify Push Notifications is all correct on that view. For me it had a "Fix Me" I had to click, and voila.
其实很容易。出于某种原因,它在 Xcode 8 上被禁用,但转到 Targets -> Capabilities 并验证 Push Notifications 在该视图上是否全部正确。对我来说,它有一个“修复我”,我必须点击,瞧。
回答by Bruce Tsai
回答by timgcarlson
There was a change in Xcode 8, where your entitlements no longer come from the App Identifiers, but from the capabilities selected in your app target. So, like Unome (the OP) said, you have to verify that Push Notifications is switched on.
在 Xcode 8 中发生了变化,您的权利不再来自应用标识符,而是来自应用目标中选择的功能。因此,就像 Unome(OP)所说的那样,您必须验证推送通知是否已打开。
For me, it wasn't a "Fix Me" button, but I had two entitlement files (one for development and one for distribution). Toggling the Push Notifications capability would add the aps-environment
key - with the value development
- to the development entitlements file, but it wouldn't add it to the distribution entitlements file. Copying the same key over to distribution worked to get rid of the warning email when uploading to iTunes Connect.
对我来说,它不是“修复我”按钮,而是我有两个授权文件(一个用于开发,一个用于分发)。切换推送通知功能会将aps-environment
密钥(带有值)添加development
到开发权利文件中,但不会将其添加到分发权利文件中。将相同的密钥复制到分发中可以在上传到 iTunes Connect 时消除警告电子邮件。
For most projects, it should be sufficient to toggle on Push Notifications, or if it's already on but the key isn't in the entitlements, try toggling it off and on again.
对于大多数项目,打开推送通知应该就足够了,或者如果它已经打开但密钥不在权利中,请尝试关闭并再次打开它。
回答by mattyohe
From the Xcode release notes:
从 Xcode发行说明:
Xcode 8 does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. (28076333)
Xcode 8 不会在构建时自动从配置文件中复制 aps-environment 权利。这种行为是故意的。要使用此权利,请在项目编辑器的“功能”窗格中启用推送通知,或手动将权利添加到您的权利文件中。(28076333)
This is a great change as it was always quite odd that the aps-environment entitlement didn't require the plist, but many others did.
这是一个很大的变化,因为 aps-environment 权利不需要 plist 总是很奇怪,但许多其他人却这样做了。
For those of you that do not want to just blindly press "Fix Me" and do not currently have an entitlements file, it is just a plist file which is referenced in your project's Build Settings under "Code Signing Entitlements"
对于那些不想盲目按“修复我”并且当前没有权利文件的人,它只是一个 plist 文件,在“代码签名权利”下的项目构建设置中引用
回答by James L Harris
After a day of struggle with Xcode 8 we could not figure out why the aps-environment
development was NOT added to our debug builds. It was missing from the entitlements section in the built app for debug testing... even though we had ENABLED the new Capability and the entitlements file existed. The issue is that the entitlements file needs to be set for ANY SDK in the Xcode Build Settings for Debug Entitlements.
经过一天的 Xcode 8 斗争,我们无法弄清楚为什么没有将aps-environment
开发添加到我们的调试版本中。它在用于调试测试的构建应用程序的权利部分中丢失了......即使我们已经启用了新的功能并且权利文件存在。问题是需要在调试权利的 Xcode 构建设置中为任何 SDK 设置权利文件。
回答by Ruben
I got the same email from Apple using XCode 7.3.1. What I did to solve the problem was:
我使用 XCode 7.3.1 收到了来自 Apple 的相同电子邮件。我为解决问题所做的是:
- Under Capabilities > Set PUSH notification ON as stated in @Bruce Tsai answer.
- Under Build-Settings > Code Signing > Code Signing Identity set the developer cert for debug and the distribution cert for release, as is shown in the image:
- 根据@Bruce Tsai 的回答,在 Capabilities > Set PUSH notification ON 下。
- 在 Build-Settings > Code Signing > Code Signing Identity 下,设置用于调试的开发人员证书和用于发布的分发证书,如图所示:
回答by Aaron Halvorsen
If you're using Firebase frameworks and aren't using push notifications there are two solutions 1. just put up with the 'issue' message that gets sent to your whole team every time uploading a binary. The app will still be accepted as a submission as long as you're not actually using notifications you can ignore the warning. or 2. do this: https://stackoverflow.com/a/46802075/7529450. This will remove the annoying email notification and also get accepted as a submission.
如果您使用 Firebase 框架并且不使用推送通知,则有两种解决方案 1. 只需忍受每次上传二进制文件时发送给整个团队的“问题”消息。只要您实际上没有使用通知,您就可以忽略该警告,该应用程序仍将被接受为提交。或 2. 这样做:https: //stackoverflow.com/a/46802075/7529450。这将删除烦人的电子邮件通知,并作为提交被接受。
回答by Shemeer M Ali
回答by Aldracor
Using Xcode 9 push Notifications was enabled.
使用 Xcode 9 推送通知已启用。
I tried disabling/re-enabling Push Notificationcapabilities. (didn't work)
我尝试禁用/重新启用推送通知功能。(没用)
I tried disabling/re-enabling Automatically manage signing. (didn't work)
我尝试禁用/重新启用自动管理签名。(没用)
Turns out I had to delete and re-add my provisioning profiles. (see here how to do it) You might have to disable/re-enable Automatically manage signingafter wards.
结果我不得不删除并重新添加我的配置文件。(请参阅此处的操作方法) 您可能必须禁用/重新启用在病房后自动管理签名。
回答by Alexander Zinchuk
For me the problem was because there were two entitlements files: Entitlements-Debug.plist
and Entitlements-Release.plist
. And only one of them (Debug) has needed settings in it.
对我来说,问题是因为有两个权利文件:Entitlements-Debug.plist
和Entitlements-Release.plist
. 并且其中只有一个(调试)需要在其中进行设置。
Changing multiple value of Build Settings > Signing > Code Signing Entitlementsto a single MyAppName/MyAppName.entitlements
and then reenabling Capabilities > Push Notificationsswitcher did the trick for me.
要改变多值生成设置>签名>代码签名应享权利,以一个单一的MyAppName/MyAppName.entitlements
,然后重新启用功能>推送通知切换奏效了我。
Hope it helps.
希望能帮助到你。