ios - 如何在 Xcode 中更改 Watchkitapp 和扩展的代码签名权利

标签 ios xcode app-store watchkit

我的应用程序编译和存档正常,但上传到 Apple 商店时失败,并显示以下错误消息:

Prepared archive for uploading Upload failed error: App Store Connect Operation Error ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'WF3BGN675V.net.brian-fitzgerald.changes' for key 'application-identifier' in 'Payload/I-Ching.app/Watch/watchkitapp.app/watchkitapp' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier."

error: App Store Connect Operation Error ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'WF3BGN675V.net.brian-fitzgerald.changes' for key 'application-identifier' in 'Payload/I-Ching.app/Watch/watchkitapp.app/PlugIns/watchkitapp Extension.appex/watchkitapp Extension' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier."

但是显示的字符串是我的 TeamID,后跟一个点,后跟包标识符!或者它是否期待 watch 套件的包标识符?因为如果是这样,它不会从 watchkit 应用程序的 info.plist 文件中获取它,该文件被分配给 net.brian-fitzgerald.changes.watchkitapp

info.plist watchkitapp

info.plist for watchkitappextension

我花了几个小时尝试改变一切我能做的事情来签署授权和配置文件,摆弄捆绑ID层次结构,清理、重建和重新清理。我得到的唯一结果是构建失败或成功构建并显示此消息。

我看过很多关于其他 ITMS-90046 错误的帖子,但没有涉及 watchkitapp 和扩展未报告正确的团队和捆绑语法。

我错过了什么?

更新:按照@Help的建议,我通过删除文件本身以及从项目plist中删除它们的路径来重新生成我的权利文件。

问题仍然存在,但有不同的错误消息:

enter image description here

同样,plist bundle 标识符和配置文件中的标识符之间没有不匹配。我的 Entitlements-Release.plist 是:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>WF3BGN675V.net.brian-fitzgerald.changes</string>
    <key>aps-environment</key>
    <string>production</string>
    <key>com.apple.security.application-groups</key>
    <array>
        <string>group.net.brian-fitzgerald.changes</string>
    </array>
</dict>
</plist>

最佳答案

找到了。字面上浪费了几天时间,我希望这可以帮助其他人避免一些拉扯的头发。

info.plist 并不是分配 Watchkit 和 Watchkit 扩展包标识的唯一位置。 Watchkit 应用程序和 Watchkit 扩展目标的“build设置”中有一个包标识符键:无论您在 info.plist 中放入什么内容,配置配置文件都会查找匹配的内容:

enter image description here

这些键要么是 Xcode 11 中的新键,要么在我的应用程序中总是设置错误。如果是后者,我怀疑 11 的发行说明中描述的行为是罪魁祸首:

Xcode removes some entries from the Info.plist file of a product at build time if the entries are not appropriate for the platform being built for, which is useful for targets which are configured to build for multiple platforms. This behavior can be disabled by setting the build setting DISABLE_INFOPLIST_PLATFORM_PROCESSING to YES, in which case the target must assume the responsibility of managing these entries appropriately. (47797497)

需要明确的是,我没有设置该 key ,而是通过将 Watchkit 中的包标识符设置为

net.brian-fitzgerald.changes.watchkitapp

并在扩展中

net.brian-fitzgerald.changes.watchkitapp.watchkitextension

我能够将具有这些身份的配置文件分配给目标并正常构建和上传。

我从未如此高兴地看到成功上传的绿色大复选标记。我以为我的应用程序已经完蛋了。如果我的分析是正确的,我希望苹果在下一个版本说明中记录这一点。我不可能是唯一一个面临这种情况的人,而且日志记录纯粹是误导。

关于ios - 如何在 Xcode 中更改 Watchkitapp 和扩展的代码签名权利,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59313372/

相关文章:

ios - 检测距离 Collection View 中心最近的 Collection View 单元

swift - iOS 10 模拟器不工作

c++ - 类模板中名称解析的实际结果与c++ 03标准不同

ios - iOS 开发在数据收集方面的限制是什么?

javascript - 停止 iOS7 放大 webview

html - 在iOS的hpple库中对Xpath查询使用通配符

android - 将 React Native 库集成到现有的原生 iOS/Android 应用程序中

c++ - 为什么 xcode IDE 认为 `friend` 是保留字

iphone - 停止在应用商店销售并仍提供更新

app-store - 我的应用程序在iOS App Store上的可用性是什么?