没有有效的“APS-环境”的权利字符串中找到应用程序 [英] no valid 'aps-environment' entitlement string found for application

查看:130
本文介绍了没有有效的“APS-环境”的权利字符串中找到应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想配置我的应用程序支持推送通知,但不断收到此错误:
未能获得令牌,错误:错误域= NSCocoaErrorDomain code = 3000没有有效的APS-环境的权利字符串中找到应用程序的UserInfo = 0x1f818fc0 {NSLocalizedDescription =没有有效的APS-环境的权利找到了应用字符串}

I am trying to configure my app to support push notification, but keep getting this error: Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x1f818fc0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}


  • 我没有让我的应用程序(在这一点上仅用于开发)来支持推送通知。

  • 我没有创建配置文件后启用推送通知。

  • 我的包标识是一样的出现在配置文件。

  • 在我的配置文件有一个字符串:APS-环境

  • 我确信,在code签字认同部分下的项目都和目标所有的值被选择为我调配的配置文件。

任何更多的想法?谢谢你。

Any more ideas? Thanks.

推荐答案

在我的情况下,在我的provisioning profile的东西:

In my case, the stuff in my provisioning profile:

security cms -D -i ~/Downloads/spolskyDevelop.mobileprovision 
...
<key>application-identifier</key>
<string>P5GM95Q9VV.com.dca.spolsky</string>
<key>aps-environment</key>
<string>development</string>

比在实际上建立了应用程序的不同的东西(你可以找出它是通过观察X code'S日志选项卡中内置)

Was different than the stuff in the app that was actually built (you can find out where it is built by looking at Xcode's Logs tab)

codesign -d --entitlements - '/Users/drew/Library/Developer/Xcode/DerivedData/spolsky-bdbtdfjeeywhqzccpmmceqvnhgtm/Build/Products/Debug-iphoneos/spolsky-ios.app'
<dict>
    <key>application-identifier</key>
    <string>Y2X6Z7Z2GR.com.dca.spolsky-ios</string>
    <key>get-task-allow</key>
    <true/>
    <key>keychain-access-groups</key>
    <array>
        <string>Y2X6Z7Z2GR.com.dca.spolsky-ios</string>
    </array>
</dict>

这是真实的即使当前匹配下的code符号身份提示文本被指示正确的配置资料 - 奇怪,是吧?为了使一个奇怪的故事,怪异,正确的供应配置文件正在安装在设备上,当我跑,(设置>通用​​>情景模式),导致我相信供应配置文件是正确的 - 但它回落到一个通配符ID当应用程序实际上推出

This was true even though the "Currently Matches" hint text under Code Signing Identity was indicating the correct provisioning profile--weird, huh? To make a weird story weirder, the correct provisioning profile was being installed on the device when I ran, (Settings->General->Profiles) leading me to believe the provisioning profile was right--but it was falling back to a wildcard ID when the app was actually launched.

线索是这两个命令的输出的区别是:

The clue was the difference in the output of these two commands:

Y2X6Z7Z2GR 的.com.dca。斯波斯基-IOS VS P5GM95Q9VV 的.com.dca。斯波斯基

Y2X6Z7Z2GR.com.dca.spolsky-ios vs P5GM95Q9VV.com.dca.spolsky

当我做了加粗部分的比赛,该部分斜体改为自动匹配。此外,安全性的输出和codesign是一致,并且没有更多的APS-权利误差

When I made the bolded part match, the italicized part changed to match automatically. In addition, the output of security and codesign were in agreement, and no more aps-entitlement error.

在这里,我的猜测是,X code,采用我的非通配符ID的通配符风格​​匹配。 (斯波斯基毕竟,相当接近斯波斯基-IOS),这说明目前匹配的输出。可是,我在构建链将更加严格这一点,所以它在构建过程中回落到的实际通配符ID

My guess here is that XCode was using a wildcard-style match on my non-wildcard ID. ("spolsky" is, after all, quite nearly "spolsky-ios"), and this explains the "Currently Matches" output. But something in the build chain is more strict about this, so it falls back to an actual wildcard ID during the build.

这篇关于没有有效的“APS-环境”的权利字符串中找到应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆